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

SOAP::Lite Parsing question

Expand Messages
  • Steve Benzo
    Hi, I m having a problem parsing some XML in PERL with SOAP::LITE and was wondering if anyone could help me out. I m trying to get access to the each of the
    Message 1 of 3 , Oct 11, 2006
    • 0 Attachment
      Hi,

      I'm having a problem parsing some XML in PERL with SOAP::LITE and was wondering if anyone could help me out. I'm trying to get access to the each of the networkAdmin nodes (see below) while parsing the individual networks. The way I've been trying to do this heretofore is:

       for my $t ($som->valueof('//networks/network')) {
          print $t->attr->{ID} . "\n";
       #now print each of the user admins
        #doesn't work###f or my $tt($som->valueof('networkAdmin')) {
        #doesn't work### print $tt->attr{status} . "\n";
      }

      Any help you could give so that I can access the networkAdmin nodes while parsing the individual network nodes would be appreciated. XML below:

      XML below:

      <networks>
       <network ID="1600012" name="node2">
       
         <location>ireland</location>
        <date_established>2006-06-28</date_established>
       </metadata>
       <networkAdmin UID="1" name="X" techCert="C1" status="1"/>
       <networkAdmin UID="2" name="XX" techCert="D1" status="1"/>
      </network>
          <network ID="1611400" name="nodeX">
       
          <location>utah</location>
          <date_established>1954-11-24</date_established>
       </metadata>
       <networkAdmin UID="1" name="AB" techCert="A1" status="1"/>
       <networkAdmin UID="2" name="AC" techCert="E1" status="1"/>
       <networkAdmin UID="3" name="AC" techCert="E1" status="1"/>
      </network>

      Thanks in advance!


      Get your own >web address for just $1.99/1st yr. We'll help. Yahoo! Small Business.
    • Sebastian Jaenicke
      Hi, doesn t actually look like valid XML to me. On Wed, Oct 11, 2006 at 08:17:46AM -0700, Steve Benzo wrote: [..] ... ^^^^^^^^^^^ No opening tags
      Message 2 of 3 , Oct 11, 2006
      • 0 Attachment
        Hi,

        doesn't actually look like valid XML to me.

        On Wed, Oct 11, 2006 at 08:17:46AM -0700, Steve Benzo wrote:
        [..]
        > XML below:
        >
        > <networks>
        > <network ID="1600012" name="node2">
        >
        > <location>ireland</location>
        > <date_established>2006-06-28</date_established>
        > </metadata>
        ^^^^^^^^^^^

        > <networkAdmin UID="1" name="X" techCert="C1" status="1"/>
        > <networkAdmin UID="2" name="XX" techCert="D1" status="1"/>
        > </network>
        > <network ID="1611400" name="nodeX">
        >
        > <location>utah</location>
        > <date_established>1954-11-24</date_established>
        > </metadata>
        ^^^^^^^^^^^

        No opening '<metadata>' tags at all?

        > <networkAdmin UID="1" name="AB" techCert="A1" status="1"/>
        > <networkAdmin UID="2" name="AC" techCert="E1" status="1"/>
        > <networkAdmin UID="3" name="AC" techCert="E1" status="1"/>
        > </network>

        Missing '</networks>' here.

        - Sebastian
        --
        Progress (n.): The process through which Usenet has evolved from
        smart people in front of dumb terminals to dumb people in front
        of smart terminals.
        -- obs@...
      • Steve Benzo
        The XML I m working with is correct, I must have just mis-copied. Anyway, here s a snippet of the XML I m having trouble parsing. Again, I m trying to get
        Message 3 of 3 , Oct 11, 2006
        • 0 Attachment

          The XML I'm working with is correct, I must have just mis-copied. Anyway, here's a snippet of the XML I'm having trouble parsing.
          Again, I'm trying to get access to the each of the networkAdmin nodes (see below) while parsing the individual networks. The way I've been trying to do this heretofore is:

           for my $t ($som->valueof('//networks/network')) {
              print $t->attr->{ID} . "\n";
           #now print each of the user admins
            #doesn't work###f or my $tt($som->valueof('networkAdmin')) {
            #doesn't work### print $tt->attr{status} . "\n";
          }

          Here's the *correct* XML:

          <
          networks>
          - <network ID="1600012" name="node2">
          -  <metadata>
            <location>ireland</location>
            <date_established>2006-06-28</date_established>
            </metadata>
            <networkAdmin UID="1" name="X" techCert="C1" status="1" />
            <networkAdmin UID="2" name="XX" techCert="D1" status="1" />
            </network>
          - <network ID="1611400" name="nodeX">
          - <metadata>
            <location>utah</location>
            <date_established>1954-11-24</date_established>
            </metadata>
            <networkAdmin UID="1" name="AB" techCert="A1" status="1" />
            <networkAdmin UID="2" name="AC" techCert="E1" status="1" />
            <networkAdmin UID="3" name="AC" techCert="E1" status="1" />
            </network>
          </networks>


          Sebastian Jaenicke <sjaenick+SOAPLITE@...-Bielefeld.DE> wrote:
          Hi,

          doesn't actually look like valid XML to me.

          On Wed, Oct 11, 2006 at 08:17:46AM -0700, Steve Benzo wrote:
          [..]
          > XML below:
          >
          > <networks>
          > <network ID="1600012" name="node2" >
          >
          > <location>ireland< /location>
          > <date_established> 2006-06-28< /date_establishe d>
          > </metadata>
          ^^^^^^^^^^^

          > <networkAdmin UID="1" name="X" techCert="C1" status="1"/>
          > <networkAdmin UID="2" name="XX" techCert="D1" status="1"/>
          > </network>
          > <network ID="1611400" name="nodeX" >
          >
          > <location>utah< /location>
          > <date_established> 1954-11-24< /date_establishe d>
          > </metadata>
          ^^^^^^^^^^^

          No opening '<metadata>' tags at all?

          > <networkAdmin UID="1" name="AB" techCert="A1" status="1"/>
          > <networkAdmin UID="2" name="AC" techCert="E1" status="1"/>
          > <networkAdmin UID="3" name="AC" techCert="E1" status="1"/>
          > </network>

          Missing '</networks> ' here.

          - Sebastian
          --
          Progress (n.): The process through which Usenet has evolved from
          smart people in front of dumb terminals to dumb people in front
          of smart terminals.
          -- obs@burnout. demon.co. uk


          All-new Yahoo! Mail - Fire up a more powerful email and get things done faster.

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