cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Nintex Newbie

Query XML not working for node name with colon

Jump to solution

I have a soap error response and need to parse the XML - Using a QueryXML step and having issues where a colon is in the node name, which is often is in SharePoint responses.

NOT processing

not processing with semicolon

Remove the soap: bit and... voila it works

working

What am I doing wrong here?

Tried defaultNS and other things but no dice...

Tags (1)
Reply
7 Replies
Highlighted
Automation Master
Automation Master

Re: Query XML not working for node name with semicolon

Jump to solution

at first, that's not semicolon but rathet colon, which is common in XML as you noticed

at second it not problem of colon but problem of how you setup your testcase.

you will definitely not get back XML like you test with but rather something like this

<soap:Fault xmlns:soap="http://www.something.com">
  <test>123</test>
</soap:Fault>

so 'soap' which denotes namespace should have it's definition.

with that input XML following XPath should work

/soap:Fault/test

View solution in original post

Reply
Highlighted
Nintex Newbie

Re: Query XML not working for node name with colon

Jump to solution

Thanks - nice - After much messing around I got it working without a fake namespace...

/soap:Fault/defaultNS:test

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Query XML not working for node name with colon

Jump to solution

Hi ‌,

can you please select one of Marians answers as corect so others will see that there has been a solution found.

Thanks

Philipp

Reply
Highlighted
Automation Master
Automation Master

Re: Query XML not working for node name with colon

Jump to solution

Hi Sean Cochrane‌,

I'm very sorry, but answer you marked as correct doesn't work with your original input!

so, if you think my reply is not correct or doesn't work with your real input, please, update you post (correct answer) with an input which it works on.

this way it might be misleading for those who will come across this later.

thanks.

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Query XML not working for node name with colon

Jump to solution

The requirement was not to have to add fake namespaces which bloat the code - finding the defaultNS: shortcut is what I originally wanted hence why I marked my answer as correct.

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Query XML not working for node name with colon

Jump to solution

whatever your requirement was, definitely, the question and designated answer do not fit together.

they are not 'fake namespaces', without namespace definition your input string is not valid XML document, hence no XPath can work on it.

(check XML validity  eg. here http://www.xmlvalidation.com )

read my post once again, I haven't said you should add or remove anything.

I just tried to explain, from info you provided, what's the problem and a possible way how could it be resolved.

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Query XML not working for node name with colon

Jump to solution

Fine...  but both answers are correct

0 Kudos
Reply