Re: [xsl] how to define stylesheet for the XML with href

Subject: Re: [xsl] how to define stylesheet for the XML with href
From: "Spencer Tickner" <spencertickner@xxxxxxxxx>
Date: Fri, 28 Jul 2006 06:31:13 -0800
Hi

If you want to get the value of amount and currency I would think you
would want to match on multiref:

<xsl:template match="/Envelope/Body/multiRef"> <!-- Limit the matches
to that depth in the document -->

or

<xsl:template match="//multiRef"> <!-- Find all matches in the document -->

I tried both, and the both gave me "100.0" and "GBP", hope that's what
you're looking for.

Spencer



On 7/28/06, dhavalkumar thakker <dhavalkumar@xxxxxxxxxx> wrote:
Hi all,

I have a XML file ( infect, its a SOAP response recieved from a Web
service), i want to define stylesheet for this file(response). The file
is:


<?xml version="1.0" encoding="utf-8"?>


<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>

        <soapenv:Body>
                <ns1:getQuotationResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:ns1="http://WizzAir";>
                        <getQuotationReturn href="#id0"/>
                </ns1:getQuotationResponse>

<multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
xsi:type="ns2:Price" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:ns2="http://WizzAir";>

<amount xsi:type="xsd:double">100.0</amount> <currency xsi:type="xsd:string">GBP</currency> </multiRef> </soapenv:Body> </soapenv:Envelope>


I have defined the XSLT as follows(omitted some parts for simplicity):


<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
        <xsl:template match="/getQuotationReturn">
                        <xsl:variable name="X2" select="amount"/>
                        <xsl:variable name="X1" select="currency"/>

<xsl:value-of select="$X2"/>

<xsl:value-of select="$X1"/>



However, when i open the file, the value of both (X2 and X1 is
empty)...any suggestions??


Thanks.. -- Dhavalkumar Thakker Phd candidate, Semantic Web Services Research Group, Nottingham Trent University, England http://clarinet.doc.ntu.ac.uk:2000/dysec/dthakker.html

--
http://www.fastmail.fm - And now for something completely different

Current Thread