[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: how to define stylesheet for the XML with href

Subject: Re: how to define stylesheet for the XML with href
From: "Spencer Tickner" <spencertickner@xxxxxxxxx>
Date: Fri, 28 Jul 2006 06:31:13 -0800
xml define stylesheet
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.