Skip to main content
Nintex Community Menu Bar

Query XML not working for node name with colon

  • Dec 7, 2016 11:55 AM UTC
  • 7 replies
  • 62 views
  • Translate All

Forum|alt.badge.img+1

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...

7 replies

Forum|alt.badge.img+14
  • Scholar
  • Dec 7, 2016 5:39 PM UTC

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
‍

Translate

Forum|alt.badge.img+1

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

/soap:Fault/defaultNS:test

Translate

Forum|alt.badge.img+11
  • Nintex Partner
  • Dec 20, 2016 12:14 PM UTC

Hi ‌,

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

Thanks

Philipp

Translate

Forum|alt.badge.img+14
  • Scholar
  • Dec 20, 2016 11:47 PM UTC

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.

Translate

Forum|alt.badge.img+1

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.

Translate

Forum|alt.badge.img+14
  • Scholar
  • Dec 27, 2016 8:31 PM UTC

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.

Translate

Forum|alt.badge.img+1

Fine...  but both answers are correct

Translate