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

XML and Perl

Expand Messages
  • techybill
    Hi All I m trying to read a xml doc into perl and use the results of the xml doc. Just wonding what would be the best module to use as there are so many.The
    Message 1 of 1 , Sep 24, 2003
    • 0 Attachment
      Hi All
      I'm trying to read a xml doc into perl and use the results of the
      xml doc. Just wonding what would be the best module to use as there
      are so many.The xml doc that is being returned to me looks like this.


      Thanks
      ps examples would be great

      <?xml:stylesheet type = "text/xsl"?>
      <?xml version="1.0"?>
      <!DOCTYPE eparcel [
      <!-- EVERY REQUEST CONTAIN THE eparcel TAG -->
      <!ELEMENT eparcel (ratesAndServicesResponse)>

      <!-- ********************************************************* -->
      <!-- * Standard response for request for rates and services * -->
      <!-- ********************************************************* -->
      <!ELEMENT ratesAndServicesResponse (statusCode,

      statusMessage+,

      requestID,

      handling,

      language,

      product+,

      packing*,

      emptySpace*,

      shippingOptions,

      comment,

      nearestPostalOutlet*)>

      <!ELEMENT statusCode (#PCDATA)>
      <!ELEMENT statusMessage (#PCDATA)>
      <!ELEMENT requestID (#PCDATA)>
      <!ELEMENT handling (#PCDATA)>
      <!ELEMENT language (#PCDATA)>

      <!ELEMENT product (name, rate, shippingDate, deliveryDate,
      deliveryDayOfWeek, nextDayAM?, packingID)>
      <!ATTLIST product id CDATA #REQUIRED>
      <!ATTLIST product sequence CDATA
      #REQUIRED>
      <!ELEMENT name (#PCDATA)>
      <!ELEMENT rate (#PCDATA)>
      <!ELEMENT shippingDate (#PCDATA)>
      <!ELEMENT deliveryDate (#PCDATA)>
      <!ELEMENT deliveryDayOfWeek (#PCDATA)>
      <!ELEMENT nextDayAM (#PCDATA)>
      <!ELEMENT packingID (#PCDATA)>

      <!ELEMENT packing (packingID, box+)>
      <!ELEMENT box (name, weight, expediterWeight,
      length, width, height, packedItem+)>
      <!ELEMENT weight (#PCDATA)>
      <!ELEMENT expediterWeight (#PCDATA)>
      <!ELEMENT length (#PCDATA)>
      <!ELEMENT width (#PCDATA)>
      <!ELEMENT height (#PCDATA)>
      <!ELEMENT packedItem (quantity, description)>
      <!ELEMENT quantity (#PCDATA)>
      <!ELEMENT description (#PCDATA)>

      <!ELEMENT emptySpace (length, width, height, weight)>

      <!ELEMENT shippingOptions (insurance,

      deliveryConfirmation,

      signature,

      flexiblePaymentAvailable?)>
      <!ELEMENT insurance (#PCDATA)>
      <!ELEMENT deliveryConfirmation (#PCDATA)>
      <!ELEMENT signature (#PCDATA)>
      <!ELEMENT flexiblePaymentAvailable EMPTY>



      <!ELEMENT comment (#PCDATA)>


      <!--
      ********************************************************* -->
      <!-- * 'nearestPostalOutlet' is optional and is returned
      * -->
      <!-- * only if the merchant profile has this option enabled
      * -->
      <!--
      ********************************************************* -->
      <!ELEMENT nearestPostalOutlet (postalOutletSequenceNo,

      distance,

      outletName,

      businessName ,

      postalAddress,

      phoneNumber,

      businessHours+)>
      <!ELEMENT postalOutletSequenceNo
      (#PCDATA)>
      <!ELEMENT distance (#PCDATA)>
      <!ELEMENT outletName (#PCDATA)>
      <!ELEMENT businessName (#PCDATA)>
      <!ELEMENT postalAddress (addressLine+, postalCode ,
      municipality)>
      <!ELEMENT addressLine (#PCDATA)>
      <!ELEMENT postalCode (#PCDATA)>
      <!ELEMENT municipality (#PCDATA)>
      <!ELEMENT phoneNumber (#PCDATA)>
      <!ELEMENT businessHours (dayId, dayOfWeek, time)>
      <!ELEMENT dayId
      (#PCDATA)>
      <!ELEMENT dayOfWeek
      (#PCDATA)>
      <!ELEMENT time
      (#PCDATA)>


      ]>
      <eparcel>
      <ratesAndServicesResponse>

      <statusCode>1</statusCode>
      <statusMessage>OK</statusMessage>
      <requestID>43006</requestID>
      <handling>0.0</handling>
      <language>0</language>
      <product id="1040" sequence="1">
      <name>Priority Courier</name>
      <rate>12.67</rate>
      <shippingDate>2003-09-24</shippingDate>
      <deliveryDate>2003-09-25</deliveryDate>
      <deliveryDayOfWeek>5</deliveryDayOfWeek>
      <nextDayAM>true</nextDayAM>
      <packingID>P_0</packingID>
      </product>
      <product id="1030" sequence="2">
      <name>Xpresspost</name>
      <rate>5.06</rate>
      <shippingDate>2003-09-24</shippingDate>
      <deliveryDate>2003-09-25</deliveryDate>
      <deliveryDayOfWeek>5</deliveryDayOfWeek>
      <nextDayAM>false</nextDayAM>
      <packingID>P_0</packingID>
      </product>
      <product id="1010" sequence="3">
      <name>Regular</name>
      <rate>5.71</rate>
      <shippingDate>2003-09-24</shippingDate>
      <deliveryDate>2003-09-26</deliveryDate>
      <deliveryDayOfWeek>6</deliveryDayOfWeek>
      <nextDayAM>false</nextDayAM>
      <packingID>P_0</packingID>
      </product>


      <packing>
      <packingID>P_0</packingID>
      <box>
      <name>Box</name>
      <weight>0.32</weight>

      <expediterWeight>0.32</expediterWeight>
      <length>0.1</length>
      <width>0.1</width>
      <height>0.1</height>

      <packedItem>
      <quantity>1</quantity>

      <description>Box</description>
      </packedItem>


      </box>

      </packing>

      <shippingOptions>
      <insurance>No</insurance>

      <deliveryConfirmation>Yes</deliveryConfirmation>
      <signature>No</signature>

      </shippingOptions>

      <comment></comment>


      </ratesAndServicesResponse>
      </eparcel>
      <!--END_OF_EPARCEL-->
    Your message has been successfully submitted and would be delivered to recipients shortly.