Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 21st, 2004, 01:36 PM
Registered User
 
Join Date: Oct 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by ryanpatrick
 Hello, I did resolve my issues with this. Thank you for getting back to me regaurdless. For anyone that is having a tough time with implementing the UPS XML Tracking, FedEx XML Tracking I have have both working and tested. Email me for code samples



Tommy Smith
 
Old October 21st, 2004, 01:44 PM
Registered User
 
Join Date: Oct 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ryanpatrick could you send me the coding for UPS and FED Ex Tracking. Having Touch time.
Trying to make my TRKCODE ELEMENT that has a link go to UPS/FED Ex Tracking.

--XML-
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="DOLWMDDXSL2.xsl"?>
<ORDERREQUISITION>
<REQUISITION>
<DATECRE>10/21/04</DATECRE>
<ORDNBR>2004226003658</ORDNBR>
<CUSTID>B0475</CUSTID>
<ORDQTY>1</ORDQTY>
<QTYDENIED>0</QTYDENIED>
<STATUS>SHIPPED!</STATUS>
<SHIPQTY>1</SHIPQTY>
<SHIPDATE>10/20/04</SHIPDATE>
<DEPOT>STLMO</DEPOT>
<CARRIERID>STDA</CARRIERID>
<CARRIERMODE>New: 1st Class Mail</CARRIERMODE>
<TRKCODE>000 890767#</TRKCODE>
</REQUISITION>
<REQUISITION>
<DATECRE>10/21/04</DATECRE>
<ORDNBR>2004265002722</ORDNBR>
<CUSTID>J0793</CUSTID>
<ORDQTY>13</ORDQTY>
<QTYDENIED>0</QTYDENIED>
<STATUS>SHIPPED!</STATUS>
<SHIPQTY>13</SHIPQTY>
<SHIPDATE>10/20/04</SHIPDATE>
<DEPOT>STLMO</DEPOT>
<CARRIERID>UPS</CARRIERID>
<CARRIERMODE>UPS Ground</CARRIERMODE>
<TRKCODE>1Z6816110368879763</TRKCODE>
<UPSXMLACCESS>
<?xml version="1.0"?>
<AccessRequest xml:lang="en-U">
<AccessLicenseNumber>5BAC51B0D14FC5C0</AccessLicenseNumber>
<UserId>smith3863</UserId>
<Password>ra3863Hx</Password>
</AccessRequest>
</UPSXMLACCESS>
<UPSXMLREQUEST>
<?xml version="1.0"?>
<TrackRequest xml:lang="en-US">
<Request>
<TransactionReference>
<CustomerContext>J0793</CustomerContext>
<XpciVersion>1.0001</XpciVersion>
</TransactionReference>
<RequestAction>Track</RequestAction>
<RequestOption>activity</RequestOption>
</Request>
<TrackingNumber>1Z6816110368879763</TrackingNumber>
</TrackRequest>
</UPSXMLREQUEST>
<UPSXMLRESPONSE>
<?xml version="1.0"?>
<TrackResponse>
<Response>
<TransactionReference>
<XpciVersion>1.0001</XpciVersion>
</TransactionReference>
<ResponseStatusCode>0</ResponseStatusCode>
<ResponseStatusDescription></ResponseStatusDescription>
</Response>
<Shipment>
<Shipper>
<ShipperNumber>681611</ShipperNumber>
</Shipper>
<ShipTo>
</ShipTo>
<Service>
<Code>003</Code>
<Description>Ground</Description>
</Service>
<Package>
</Package>
</Shipment>
</TrackResponse>
</UPSXMLRESPONSE>
</REQUISITION>
</ORDERREQUISITION>

--XSL--

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:param name="nameSearchValue">2004265002722</xsl:param>

<xsl:template match="/">
   <HTML>
      <BODY>
         <TABLE border="10" align="center">
            <xsl:apply-templates select="/ORDERREQUISITION/REQUISITION">
               <xsl:sort select="ORDNBR"/>
               </xsl:apply-templates>
         </TABLE>
      </BODY>
   </HTML>
</xsl:template>

<xsl:template match="REQUISITION">
  <xsl:if test="ORDNBR=$nameSearchValue">

     <TR> <xsl:apply-templates select="DATECRE" />
     <xsl:apply-templates select="SHIPQTY" /></TR>
     <TR> <xsl:apply-templates select="ORDNBR" />
     <xsl:apply-templates select="SHIPDATE" /></TR>
     <TR><xsl:apply-templates select="CUSTID" />
     <xsl:apply-templates select="DEPOT" /></TR>
     <TR><xsl:apply-templates select="ORDQTY" />
     <xsl:apply-templates select="CARRIERID" /></TR>
     <TR><xsl:apply-templates select="QTYDENIED" />
     <xsl:apply-templates select="CARRIERMODE" /></TR>
     <TR><xsl:apply-templates select="STATUS" />
     <xsl:apply-templates select="TRKCODE" />
     </TR>
     <TR>
     </TR>
     <TR>
     </TR>
   </xsl:if>
</xsl:template>

<xsl:template match="DATECRE">
   <TD bgcolor="lightblue"><B>Received Date: </B>
   <xsl:apply-templates />
   </TD>
</xsl:template>

<xsl:template match="SHIPQTY">
  <TD bgcolor="lightblue"><B>Ship Qty: </B>
  <xsl:apply-templates /> </TD>
</xsl:template>

<xsl:template match="ORDNBR">
  <TD bgcolor="lightblue"><B>Order Nbr: </B>
  <xsl:apply-templates /> </TD>
</xsl:template>

<xsl:template match="SHIPDATE">
 <TD bgcolor="lightblue"><B>Ship Date: </B>
 <xsl:apply-templates /> </TD>
</xsl:template>

<xsl:template match="CUSTID">
  <TD bgcolor="lightblue"><B>Customer Nbr: </B>
  <xsl:apply-templates /> </TD>
</xsl:template>

<xsl:template match="DEPOT">
  <TD bgcolor="lightblue"><B>Depot: </B>
  <xsl:apply-templates /> </TD>
</xsl:template>
<xsl:template match="ORDQTY">
  <TD bgcolor="lightblue"><B>Order Qty: </B>
  <xsl:apply-templates /> </TD>
</xsl:template>
<xsl:template match="CARRIERID">
  <TD bgcolor="lightblue"><B>Carrier: </B>
    <xsl:apply-templates /> </TD>
</xsl:template>
<xsl:template match="QTYDENIED">
 <TD bgcolor="lightblue"><B>Qty Denied: </B>
   <xsl:apply-templates /> </TD>
</xsl:template>
<xsl:template match="CARRIERMODE">
 <TD bgcolor="lightblue"><B>Ship Mode: </B>
   <xsl:apply-templates /> </TD>
</xsl:template>
<xsl:template match="STATUS">
  <TD bgcolor="lightblue"><B>Status: </B>
    <xsl:apply-templates /> </TD>
</xsl:template>

--Like to link this Element to UPS--
<xsl:template match="TRKCODE">
<xsl:if test="starts-with(text(), '1Z')">
<td bgcolor="lightblue">
<b>Tracking Nbr:
<a href="http://wwwcie.ups.com/ups.app/xml/TRACK/UPSXMLACCESS/UPSXMLREQUEST/UPSXMLRESPONSE">
  <xsl:value-of select="." />
  </a>
  </b>
  </td>
  </xsl:if>

<xsl:if test="starts-with(text(), '000')">
<td bgcolor="lightblue">
<b>Tracking Nbr:
<a href="http://www.usps.com/">
  <xsl:value-of select="." />
  </a>
  </b>
  </td>
  </xsl:if>
</xsl:template>


</xsl:stylesheet>


Tommy Smith
 
Old December 1st, 2004, 07:11 AM
Registered User
 
Join Date: Dec 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by smitht
 
Quote:
quote:Originally posted by ryanpatrick
Quote:
 Hello, I did resolve my issues with this. Thank you for getting back to me regaurdless. For anyone that is having a tough time with implementing the UPS XML Tracking, FedEx XML Tracking I have have both working and tested. Email me for code samples



Tommy Smith

Dear Smith

I am interested in UPS tools and I need to implement them in my ASP site. Could you please provide me with some sample code written in ASP+XML to track UPS purchase and etc. I really appreciate your help.

Thanks and Regards
Suranga.
[email protected]
 
Old May 31st, 2005, 08:10 AM
Authorized User
 
Join Date: Jun 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Does any one have the UPS Rates and Service implemented into their website???

I'm new to XML and I don't know where to start to get thsi to work. I got the XML file from UPS but I don't know how to make it work with my ASP.NET web page.

Thanks

Sincerely; Oscar Martinez
 
Old May 31st, 2005, 08:19 AM
Authorized User
 
Join Date: May 2005
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What I want to know is how on earth there are so many peeps wanting to know how UPS tracking works!

What is this a college assignment or a bad example from a book?

It is by grace we are saved!
 
Old May 31st, 2005, 09:15 AM
Authorized User
 
Join Date: Jun 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well think about in a Business point off view. If you would like to make your business better you will need to provide your customer with fast and accurate information. Companies are implemting this process into their Company web site. Suppost you buy a Memory card and you would like to track it down all you need to do is go to the companied web site, enter your order # and it will tell where your package is located. It's pretty cool. UPS is very flexible.

What is this a college assignment or a bad example from a book? Basically their is not alot of Example. If you know how to do this you should post a FAQ. Well I hope you understand what people are trying to do.

Thanks

Sincerely; Oscar Martinez
 
Old May 31st, 2005, 09:22 AM
Authorized User
 
Join Date: May 2005
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

lol - I just thought it a little strange why so many people are having problems
trying to do exactly the same sort of thing!

Whatever the reason I'm down with it m8ty but I think I will pass on the FAQ bit,
far too infrequent for me to really consider such a drastic move!

It is by grace we are saved!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting Source Xml into Target Xml Using XSL. alapati.sasi XSLT 3 May 14th, 2007 10:54 AM
Transforming XML to XML using XSL sakreck XSLT 0 January 9th, 2007 11:48 AM
XSL and XML Antti XSLT 2 January 5th, 2007 05:36 AM
XML To XML, using XSL & XSD supercop75 XSLT 1 April 8th, 2006 02:48 AM
xml and xsl templates as input to xslt gives xml rameshnarayan XSLT 5 August 3rd, 2005 01:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.