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

How to get attributes of items several layers down.

Expand Messages
  • dclaarit
    With WSRF::Lite, I get back the structure below. There can be multiple ITEM entries.
    Message 1 of 1 , Apr 16 3:10 PM
    • 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 />
        <soapenv:Body>
          <ns:getAllNotesResponse xmlns:ns="http://service/xsd">
            <ns:return>
              <ITEMS>
                <ITEM ID="1000380239">
                  <NOTE NAME="Lab Notes">
                    <NOTECONTENT>Lorem ipsum dolor</NOTECONTENT>
                  </NOTE>
                  <NOTE NAME="Lorem Ipsum">
                    <NOTECONTENT>Lorem ipsum dolor</NOTECONTENT>
                  </NOTE>
                  <RETURNCODE>0</RETURNCODE>
                  <RETURNMSG></RETURNMSG>
                </ITEM>
                <RETURNCODE>0</RETURNCODE>
                <RETURNMSG />
              </ITEMS>
            </ns:return>
          </ns:getAllNotesResponse>
        </soapenv:Body>
      </soapenv:Envelope>',


      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

    Your message has been successfully submitted and would be delivered to recipients shortly.