shrimpy
05-07-08, 12:32 PM
i try to get some data from this sample file
<part name="request">
<request xmlns:aensTYPE="http://www.TA.com.au/TravelAgent" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="aensTYPE:RequestType">
<ns1:Customer xmlns:ns1="http://www.TA.com.au/TravelAgent">
<ns1:FirstName>firstName</ns1:FirstName>
<ns1:MiddleName>middleName</ns1:MiddleName>
<ns1:LastName>lastName</ns1:LastName>
<ns1:CustomerAddress>address</ns1:CustomerAddress>
<ns1:CustomerPhoneNumber>0432575467</ns1:CustomerPhoneNumber>
<ns1:CustomerPassportDetails>
<ns1:Number>passport111</ns1:Number>
<ns1:DateOfBirth>2008-05-08</ns1:DateOfBirth>
<ns1:IssueDate>2008-05-08</ns1:IssueDate>
<ns1:ExpiryDate>2008-05-08</ns1:ExpiryDate>
<ns1:IssuingCountry>Australia</ns1:IssuingCountry>
<ns1:Type>Normal</ns1:Type>
</ns1:CustomerPassportDetails>
</ns1:Customer>
<ns2:Itinerary xmlns:ns2="http://www.TA.com.au/TravelAgent">
<ns2:From>sydney</ns2:From>
<ns2:To>melbone</ns2:To>
<ns2:DepartureDate>2008-05-08</ns2:DepartureDate>
<ns2:ReturnDate>2008-05-08</ns2:ReturnDate>
<ns2:Class>firstClass</ns2:Class>
<ns2:isReturn>false</ns2:isReturn>
</ns2:Itinerary>
<ns3:Hotel xmlns:ns3="http://www.TA.com.au/TravelAgent">
<ns3:HotelLocation>somewhere</ns3:HotelLocation>
<ns3:HotelClass>3</ns3:HotelClass>
<ns3:CheckinDate>2008-05-08</ns3:CheckinDate>
<ns3:CheckoutDate>2008-05-08</ns3:CheckoutDate>
<ns3:roomType>single</ns3:roomType>
<ns3:smokingPreference>smoking</ns3:smokingPreference>
</ns3:Hotel>
<ns4:Car xmlns:ns4="http://www.TA.com.au/TravelAgent">
<ns4:StartDate>2008-05-08</ns4:StartDate>
<ns4:EndDate>2008-05-08</ns4:EndDate>
<ns4:CarType>small</ns4:CarType>
</ns4:Car>
<ns5:Payment xmlns:ns5="http://www.TA.com.au/TravelAgent">
<ns5:CreditCard>
<ns5:Number>12345</ns5:Number>
<ns5:Expiry>2008-09</ns5:Expiry>
<ns5:NameOnCard>creditcard1</ns5:NameOnCard>
</ns5:CreditCard>
</ns5:Payment>
</request>
</part>
and i wrote this xsl file
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns1="http://www.TA.com.au/TravelAgent"
xmlns:air="http://***1.com/options/option1/Airline/wsdl"
xmlns:nsAir="http://***1.com/options/option1/Airline/schema"
version="1.1">
<xsl:template match="/">
<air:BookRequestInfo>
<xsl:apply-templates match="ns1:Customer" />
</air:BookRequestInfo>
</xsl:template>
<xsl:template match="ns1:Customer">
<nsAir:bookRequest>
<nsAir:flightNumber>
<xsl:text>Quta-1234</xsl:text>
</nsAir:flightNumber>
<nsAir:classOfSeat>
<xsl:text>EconomicClass</xsl:text>
</nsAir:classOfSeat>
<nsAir:firstname>
<xsl:value-of select="ns1:FirstName" />
</nsAir:firstname>
<nsAir:lastname>
<xsl:value-of select="ns1:LastName" />
</nsAir:lastname>
<nsAir:passport>
<xsl:value-of
select="ns1:CustomerPassportDetails/ns1:Number" />
</nsAir:passport>
</nsAir:bookRequest>
</xsl:template>
</xsl:stylesheet>
but why i can not get the proper result????
is it anything i did wrong?
<part name="request">
<request xmlns:aensTYPE="http://www.TA.com.au/TravelAgent" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="aensTYPE:RequestType">
<ns1:Customer xmlns:ns1="http://www.TA.com.au/TravelAgent">
<ns1:FirstName>firstName</ns1:FirstName>
<ns1:MiddleName>middleName</ns1:MiddleName>
<ns1:LastName>lastName</ns1:LastName>
<ns1:CustomerAddress>address</ns1:CustomerAddress>
<ns1:CustomerPhoneNumber>0432575467</ns1:CustomerPhoneNumber>
<ns1:CustomerPassportDetails>
<ns1:Number>passport111</ns1:Number>
<ns1:DateOfBirth>2008-05-08</ns1:DateOfBirth>
<ns1:IssueDate>2008-05-08</ns1:IssueDate>
<ns1:ExpiryDate>2008-05-08</ns1:ExpiryDate>
<ns1:IssuingCountry>Australia</ns1:IssuingCountry>
<ns1:Type>Normal</ns1:Type>
</ns1:CustomerPassportDetails>
</ns1:Customer>
<ns2:Itinerary xmlns:ns2="http://www.TA.com.au/TravelAgent">
<ns2:From>sydney</ns2:From>
<ns2:To>melbone</ns2:To>
<ns2:DepartureDate>2008-05-08</ns2:DepartureDate>
<ns2:ReturnDate>2008-05-08</ns2:ReturnDate>
<ns2:Class>firstClass</ns2:Class>
<ns2:isReturn>false</ns2:isReturn>
</ns2:Itinerary>
<ns3:Hotel xmlns:ns3="http://www.TA.com.au/TravelAgent">
<ns3:HotelLocation>somewhere</ns3:HotelLocation>
<ns3:HotelClass>3</ns3:HotelClass>
<ns3:CheckinDate>2008-05-08</ns3:CheckinDate>
<ns3:CheckoutDate>2008-05-08</ns3:CheckoutDate>
<ns3:roomType>single</ns3:roomType>
<ns3:smokingPreference>smoking</ns3:smokingPreference>
</ns3:Hotel>
<ns4:Car xmlns:ns4="http://www.TA.com.au/TravelAgent">
<ns4:StartDate>2008-05-08</ns4:StartDate>
<ns4:EndDate>2008-05-08</ns4:EndDate>
<ns4:CarType>small</ns4:CarType>
</ns4:Car>
<ns5:Payment xmlns:ns5="http://www.TA.com.au/TravelAgent">
<ns5:CreditCard>
<ns5:Number>12345</ns5:Number>
<ns5:Expiry>2008-09</ns5:Expiry>
<ns5:NameOnCard>creditcard1</ns5:NameOnCard>
</ns5:CreditCard>
</ns5:Payment>
</request>
</part>
and i wrote this xsl file
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns1="http://www.TA.com.au/TravelAgent"
xmlns:air="http://***1.com/options/option1/Airline/wsdl"
xmlns:nsAir="http://***1.com/options/option1/Airline/schema"
version="1.1">
<xsl:template match="/">
<air:BookRequestInfo>
<xsl:apply-templates match="ns1:Customer" />
</air:BookRequestInfo>
</xsl:template>
<xsl:template match="ns1:Customer">
<nsAir:bookRequest>
<nsAir:flightNumber>
<xsl:text>Quta-1234</xsl:text>
</nsAir:flightNumber>
<nsAir:classOfSeat>
<xsl:text>EconomicClass</xsl:text>
</nsAir:classOfSeat>
<nsAir:firstname>
<xsl:value-of select="ns1:FirstName" />
</nsAir:firstname>
<nsAir:lastname>
<xsl:value-of select="ns1:LastName" />
</nsAir:lastname>
<nsAir:passport>
<xsl:value-of
select="ns1:CustomerPassportDetails/ns1:Number" />
</nsAir:passport>
</nsAir:bookRequest>
</xsl:template>
</xsl:stylesheet>
but why i can not get the proper result????
is it anything i did wrong?