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

Re: How to transform multiple XML docs with XSLT 2.0 i

Subject: Re: How to transform multiple XML docs with XSLT 2.0 into single doc
From: Jack Bush <netbeansfan@xxxxxxxxxxxx>
Date: Fri, 25 Jun 2010 07:39:58 -0700 (PDT)
Re:  How to transform multiple XML docs with XSLT 2.0 i
Hi Paul,
B 
Below is the original stylesheet.xsl for the secondary XML source
document (e.g. Sport.xml):
B <?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="2.0"
B B B B B B B B B B B B B B B B B B B B 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
B B B B B B B B B B B B B B B B B B B B B xmlns:ns="http://www.w3.org/1999/xh
tml"
B  exclude-result-prefixes="ns">
B 
B  <xsl:template match="/">
B B B 
<sport>
B B B  <xsl:for-each select="//ns:p">
B B B B B  <name><xsl:value-of
select="substring-before(@title,',')"/></name>
B B B B B  <photo><xsl:value-of
select="@href"/></photo>
B B B  </xsl:for-each>
B B B  </sport>
B 
</xsl:template>
</xsl:stylesheet>
B I am still not clear on how to reference
these values in Sport.xml from within primary stylesheet. Any ideas on how
this could be achieved by wrapping Sport.xml around a variable followed by
XPath query on it?
B 
Thanks a lot,
Jack
c

----- Original Message ----
From: Paul Harvey <paul_harv_2@xxxxxxxxx>
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Sent: Wed, 23 June, 2010 4:38:13 AM
Subject: Re:  How to transform
multiple XML docs with XSLT 2.0 into single doc

Hi,
I have this...
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exslt="http://exslt.org/common">

B  <xsl:variable name="data">
B  B 
<root>
B  B  B  <test>1000</test>
B  B  B  <test>2000</test>
B  B  B 
<test>3000</test>
B  B  </root>
B  </xsl:variable>B  

B  <xsl:template
match="/">
B  B  <xsl:for-each select="$data/root/test">
B  B  B  B 
<xsl:for-each select="."/>
B  B  </xsl:for-each>
B  </xsl:template>
</xsl:stylesheet>

And I thought that with XSLT 1.1B  the $data variable would
be treated as a node-set and that therefore standard XSLT stuff - like
for-each - should work.
I don't get an error, but I get no output - it's as
though the $data nodeset is completely empty.
I've also tried this
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exslt="http://exslt.org/common">

B  B  B  <xsl:variable name="data">
B 
B  B  B  <root>
B  B  B  B  B  <test>1000</test>
B  B  B  B  B 
<test>2000</test>
B  B  B  B  B  <test>3000</test>
B  B  B  B  </root>
B  B 
B  </xsl:variable>B  

B  B  B  <xsl:template match="/">
B  B  B  B 
<xsl:for-each select="exslt:node-set($data)/root/test">
B  B  B  B  B  B 
<xsl:for-each select="."/>
B  B  B  B  </xsl:for-each>
B  B  B 
</xsl:template>

</xsl:stylesheet>

With the same results. (Infact, I've done
this before with no problems) I'm using Saxon.
What am I missing? (I'm not in
a position to use XSLT 2.0 by the way)
Thanks


B  B  B 

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.