From c9c22f6d18998e430883d75a12156304e32c421d Mon Sep 17 00:00:00 2001 From: Ivaylo Dimitrov Date: Wed, 28 Oct 2020 17:20:15 +0200 Subject: [PATCH] BUG: Correctly parse structures even if first child is not element We may have comment or processing instruction as first child, so iterate over all children and try to find element child. Abort iteration if such child is found Signed-off-by: Ivaylo Dimitrov --- src/qtsoap.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/qtsoap.cpp b/src/qtsoap.cpp index c72fd9c..61f8f33 100644 --- a/src/qtsoap.cpp +++ b/src/qtsoap.cpp @@ -2997,7 +2997,14 @@ QtSmartPtr QtSoapTypeFactory::soapType(QDomNode node) const if (attr.isNull() || !constructor) { QHash::ConstIterator it; - if (node.firstChild().isElement()) { + bool hasElemNode = false; + for (int i = 0; i < node.childNodes().count(); i++) { + if (node.childNodes().at(i).isElement()) { + hasElemNode = true; + break; + } + } + if (hasElemNode) { if (localName(node.nodeName().toLower()) == "array") { it = typeHandlers.find("array"); } else