Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy New to XML - Help w/ Freight Quote API Please

    I am fairly new to XML but ideally proficient in HTML. I am trying to implement a Freight Quote Calculator into our website. I am confused what and where exactly I put these codes or XML files for that matter. The freight company gave me some samples to work with:

    **I can get to the point where it completes the request and I recieve an XML page full of data similar to the data below. However, what do I do with this data? Do I link it to the Definitions below somehow to display user-friendly information?**

    Sample XML Rate Quote Data Stream
    After you have completed your request, you will receive an XML data stream like the example below, providing the rate quote you requested.
    If an error occurs processing your request, a status code will indicate the nature of the error.

    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE RATEQUOTE (View Source for full doctype)>
    <RATEQUOTE>
    <STATUS />
    <SHIPPERZIPCODE>66223</SHIPPERZIPCODE>
    <SHIPPERZIPCODESERVEDBYTRM>KANSAS CITY, MO</SHIPPERZIPCODESERVEDBYTRM>
    <SHIPPERZIPCODESERVEDBYTRMTYPE>Direct</SHIPPERZIPCODESERVEDBYTRMTYPE>
    <CONSIGNEEZIPCODE>11234</CONSIGNEEZIPCODE>
    <CONSIGNEEZIPCODESERVEDBYTRM>QUEENS, NY</CONSIGNEEZIPCODESERVEDBYTRM>
    <CONSIGNEEZIPCODESERVEDBYTRMTYPE>Direct</CONSIGNEEZIPCODESERVEDBYTRMTYPE>
    <PAYMENTINFORMATION>Shipper, Prepaid</PAYMENTINFORMATION>
    <REQUESTID />
    <SHIPMENTLINEDETAIL>
    <WEIGHT>100 lbs</WEIGHT>
    <CLASS>50</CLASS>
    <PIECES />
    </SHIPMENTLINEDETAIL>
    <SHIPMENTLINEDETAIL>
    <WEIGHT>lbs</WEIGHT>
    <CLASS />
    <PIECES />
    </SHIPMENTLINEDETAIL>
    <SHIPMENTLINEDETAIL>
    <WEIGHT>lbs</WEIGHT>
    <CLASS />
    <PIECES />
    </SHIPMENTLINEDETAIL>
    <SHIPMENTLINEDETAIL>
    <WEIGHT>lbs</WEIGHT>
    <CLASS />
    <PIECES />
    </SHIPMENTLINEDETAIL>
    <SHIPMENTLINEDETAIL>
    <WEIGHT>lbs</WEIGHT>
    <CLASS />
    <PIECES />
    </SHIPMENTLINEDETAIL>
    <CURRENCY>US Dollars</CURRENCY>
    <STANDARDGROUNDTOTAL>$217.83</STANDARDGROUNDTOTAL>
    <DEFINITEDELIVERYTOTAL>$259.10</DEFINITEDELIVERYTOTAL>
    <DEFINITEDELIVERYFROMDATE />
    <DEFINITEDELIVERYTODATE />
    <SERVICEDAYS>3</SERVICEDAYS>
    <PROJECTEDDELIVERYDATEIFSHIPPEDTODAY> 8/1/2005</PROJECTEDDELIVERYDATEIFSHIPPEDTODAY>
    <GROSSCHARGE>$361.07</GROSSCHARGE>
    <RATEDAS />
    <DISCOUNTAMOUNT>$216.64</DISCOUNTAMOUNT>
    <DISCOUNTPERCENTAGE>60%</DISCOUNTPERCENTAGE>
    <FUELSURCHARGE>$20.65</FUELSURCHARGE>
    <EXTENDEDSERVICESTOTAL>$52.75</EXTENDEDSERVICESTOTAL>
    <EXTENDEDSERVICESDETAIL>
    <EXTENDEDSERVICENAME>Inside Pickup</EXTENDEDSERVICENAME>
    <EXTENDEDSERVICEAMOUNT>$52.75</EXTENDEDSERVICEAMOUNT>
    </EXTENDEDSERVICESDETAIL>
    <RATEQUOTEID>19542958</RATEQUOTEID>
    </RATEQUOTE>

    XML Request Definition
    Use this definition to develop programming for the XML request data stream mentioned above
    <!DOCTYPE RATEQUOTE [
    <!ELEMENT RATEQUOTE (STATUS,SHIPPERZIPCODE,SHIPPERZIPCODESERVEDBYTRM,
    SHIPPERZIPCODESERVEDBYTRMTYPE,CONSIGNEEZIPCODE,
    CONSIGNEEZIPCODESERVEDBYTRM,CONSIGNEEZIPCODESERVEDBYTRMTYPE,
    PAYMENTINFORMATION,REQUESTID,SHIPMENTLINEDETAIL+,CURRENCY,
    STANDARDGROUNDTOTAL,DEFINITEDELIVERYTOTAL,DEFINITEDELIVERYFROMDATE,
    DEFINITEDELIVERYTODATE,SERVICEDAYS,
    PROJECTEDDELIVERYDATEIFSHIPPEDTODAY,GROSSCHARGE,RATEDAS,
    DISCOUNTAMOUNT,DISCOUNTPERCENTAGE,FUELSURCHARGE,
    EXTENDEDSERVICESTOTAL,EXTENDEDSERVICESDETAIL*,RATEQUOTEID)>
    <!ELEMENT CONSIGNEEZIPCODE (#PCDATA)>
    <!ELEMENT CONSIGNEEZIPCODESERVEDBYTRM (#PCDATA)>
    <!ELEMENT CONSIGNEEZIPCODESERVEDBYTRMTYPE (#PCDATA)>
    <!ELEMENT CURRENCY (#PCDATA)>
    <!ELEMENT DEFINITEDELIVERYTOTAL (#PCDATA)>
    <!ELEMENT DISCOUNTAMOUNT (#PCDATA)>
    <!ELEMENT DISCOUNTPERCENTAGE (#PCDATA)>
    <!ELEMENT EXTENDEDSERVICEAMOUNT (#PCDATA)>
    <!ELEMENT EXTENDEDSERVICENAME (#PCDATA)>
    <!ELEMENT EXTENDEDSERVICESDETAIL (EXTENDEDSERVICENAME,EXTENDEDSERVICEAMOUNT)>
    <!ELEMENT EXTENDEDSERVICESTOTAL (#PCDATA)>
    <!ELEMENT FUELSURCHARGE (#PCDATA)>
    <!ELEMENT GROSSCHARGE (#PCDATA)>
    <!ELEMENT RATEDAS (#PCDATA)>
    <!ELEMENT PAYMENTINFORMATION (#PCDATA)>
    <!ELEMENT PIECES (#PCDATA)>
    <!ELEMENT PROJECTEDDELIVERYDATEIFSHIPPEDTODAY (#PCDATA)>
    <!ELEMENT CLASS (#PCDATA)>
    <!ELEMENT RATEQUOTEID (#PCDATA)>
    <!ELEMENT SERVICEDAYS (#PCDATA)>
    <!ELEMENT REQUESTID (#PCDATA)>
    <!ELEMENT SHIPMENTLINEDETAIL (WEIGHT,CLASS,PIECES)>
    <!ELEMENT SHIPPERZIPCODE (#PCDATA)>
    <!ELEMENT SHIPPERZIPCODESERVEDBYTRM (#PCDATA)>
    <!ELEMENT SHIPPERZIPCODESERVEDBYTRMTYPE (#PCDATA)>
    <!ELEMENT STANDARDGROUNDTOTAL (#PCDATA)>
    <!ELEMENT STATUS (#PCDATA)>
    <!ELEMENT WEIGHT (#PCDATA)>]>

    XML Response Definition
    And use this definition to develop programming for the XML response data stream:
    <?xml version="1.0" encoding="UTF-8"?>
    <!ELEMENT RATEQUOTE (STATUS,SHIPPERZIPCODE,SHIPPERZIPCODESERVEDBYTRM,
    SHIPPERZIPCODESERVEDBYTRMTYPE,CONSIGNEEZIPCODE,
    CONSIGNEEZIPCODESERVEDBYTRM,CONSIGNEEZIPCODESERVEDBYTRMTYPE,
    PAYMENTINFORMATION,REQUESTID,SHIPMENTLINEDETAIL+,CURRENCY,
    STANDARDGROUNDTOTAL,DEFINITEDELIVERYTOTAL,SERVICEDAYS,
    PROJECTEDDELIVERYDATEIFSHIPPEDTODAY,
    DEFINITEDELIVERYFROMDATE,
    DEFINITEDELIVERYTODATE,GROSSCHARGE,RATEDAS,
    DISCOUNTAMOUNT,DISCOUNTPERCENTAGE,FUELSURCHARGE,
    EXTENDEDSERVICESTOTAL,EXTENDEDSERVICESDETAIL*,RATEQUOTEID)>
    <!ELEMENT CONSIGNEEZIPCODE (#PCDATA)>
    <!ELEMENT CONSIGNEEZIPCODESERVEDBYTRM (#PCDATA)>
    <!ELEMENT CONSIGNEEZIPCODESERVEDBYTRMTYPE (#PCDATA)>
    <!ELEMENT CURRENCY (#PCDATA)>
    <!ELEMENT DEFINITEDELIVERYTOTAL (#PCDATA)>
    <!ELEMENT DISCOUNTAMOUNT (#PCDATA)>
    <!ELEMENT DISCOUNTPERCENTAGE (#PCDATA)>
    <!ELEMENT EXTENDEDSERVICEAMOUNT (#PCDATA)>
    <!ELEMENT EXTENDEDSERVICENAME (#PCDATA)>
    <!ELEMENT EXTENDEDSERVICESDETAIL (EXTENDEDSERVICENAME,EXTENDEDSERVICEAMOUNT)>
    <!ELEMENT EXTENDEDSERVICESTOTAL (#PCDATA)>
    <!ELEMENT FUELSURCHARGE (#PCDATA)>
    <!ELEMENT GROSSCHARGE (#PCDATA)>
    <!ELEMENT RATEDAS (#PCDATA)>
    <!ELEMENT PAYMENTINFORMATION (#PCDATA)>
    <!ELEMENT PIECES (#PCDATA)>
    <!ELEMENT PROJECTEDDELIVERYDATEIFSHIPPEDTODAY (#PCDATA)>
    <!ELEMENT DEFINITEDELIVERYFROMDATE (#PCDATA)>
    <!ELEMENT DEFINITEDELIVERYTODATE (#PCDATA)>
    <!ELEMENT CLASS (#PCDATA)>
    <!ELEMENT RATEQUOTEID (#PCDATA)>
    <!ELEMENT SERVICEDAYS (#PCDATA)>
    <!ELEMENT REQUESTID (#PCDATA)>
    <!ELEMENT SHIPMENTLINEDETAIL (WEIGHT,CLASS,PIECES)>
    <!ELEMENT SHIPPERZIPCODE (#PCDATA)>
    <!ELEMENT SHIPPERZIPCODESERVEDBYTRM (#PCDATA)>
    <!ELEMENT SHIPPERZIPCODESERVEDBYTRMTYPE (#PCDATA)>
    <!ELEMENT STANDARDGROUNDTOTAL (#PCDATA)>
    <!ELEMENT STATUS (#PCDATA)>
    <!ELEMENT WEIGHT (#PCDATA)>


    Any help in this matter would be greatly appreciated; like I said before, I do not know much about XML, thank you all.

  • #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    you could use xsl to transform the xml into html for display
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •