Loading ...
Sorry, an error occurred while loading the content.

5930How to get attributes of items several layers down.

Expand Messages
  • dclaarit
    Apr 16, 2007
    • 0 Attachment
      With WSRF::Lite, I get back the structure below. There can be multiple ITEM entries.

      <?xml version=\'1.0\' encoding=\'utf-8\'?>
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
        <soapenv:Header />
          <ns:getAllNotesResponse xmlns:ns="http://service/xsd">
                <ITEM ID="1000380239">
                  <NOTE NAME="Lab Notes">
                    <NOTECONTENT>Lorem ipsum dolor</NOTECONTENT>
                  <NOTE NAME="Lorem Ipsum">
                    <NOTECONTENT>Lorem ipsum dolor</NOTECONTENT>
                <RETURNMSG />

      If I assign to an array with dataof('//ITEM'), I lose the NAME attribute. Here's what Data::Dumper shows (partial):

      $VAR1 = bless( {
                 '_name' => 'ITEM',
                 '_signature' => [],
                 '_value' => [
                                 'RETURNCODE' => '0',
                                 'RETURNMSG' => '',
                                 'NOTE' => [
      'NOTECONTENT' => 'Lorem ipsum dolor'
      'NOTECONTENT' => 'Lorem ipsum dolor'

      I know that I could iterate using dataof("//NOTE"), but I was hoping to encapsulate the knowledge of the som in a wrapper, and just deal with the ITEMs in the main code.

      I'd appreciate any suggestions, pointers, etc.

      ==Doug Claar