Skip to content

Instantly share code, notes, and snippets.

@cfedde
Last active December 24, 2015 00:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cfedde/6717131 to your computer and use it in GitHub Desktop.
Save cfedde/6717131 to your computer and use it in GitHub Desktop.
How do I get the value of the 'type=' attribute out of the 'command' tag in this XML frag?
DB<12> p $r->at('command')->to_xml
<command type="Error" xmlns="" xmlns:c="C" xsi:type="c:ErrorResponse"><summary>[Error 4007] Invalid login ID: cfedde001c_as01</summary><summaryEnglish>[Error 4007] Invalid login ID: cfedde001c_as01</summaryEnglish></command>
DB<13> x $r->at('command')->attr
empty array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment