Skip to main content
Known Participant
November 4, 2011
Answered

Colon in XML response

  • November 4, 2011
  • 1 reply
  • 1347 views

Hi,

I'm having a devil of a time with this.  I'm using cfhttp to perform a REST transaction, the returned XML being parsed with xmlparse and saved to a variable called "xmlfile".

The resulting xml has a colon in.  When I try reference part of it, my variable would look like:

#xmlfile.ns3:LookupMyAccountInfoResponse.ns3:numberOfCheckouts.xmlText#

Of course this fails due to the colons..

I understand there's some sort of bracket notation that should allow this to work. No matter where I put the brackets, it still fails.

Help?

This topic has been closed for replies.
Correct answer Owainnorth

Should be

#xmlfile["ns3:LookupMyAccountInfoResponse"]["ns3:numberOfCheckouts"].xmlText #

1 reply

Owainnorth
OwainnorthCorrect answer
Inspiring
November 4, 2011

Should be

#xmlfile["ns3:LookupMyAccountInfoResponse"]["ns3:numberOfCheckouts"].xmlText #

pkonshakAuthor
Known Participant
November 4, 2011

Thank you, thank you!  Seems so easy, but I just couldn't get it -- makes total sense now.  Much appreciated,

Peter

Owainnorth
Inspiring
November 4, 2011

No worries, it's a Friday afternoon and I had lots of more boring work to get out of.