Hi Paul,
Below is the original stylesheet.xsl for the secondary XML source document
(e.g. Sport.xml):
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="ns">
<xsl:template match="/">
<sport>
<xsl:for-each select="//ns:p">
<name><xsl:value-of select="substring-before(@title,',')"/></name>
<photo><xsl:value-of select="@href"/></photo>
</xsl:for-each>
</sport>
</xsl:template>
</xsl:stylesheet>
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?
Thanks a lot,
Jack
----- Original Message ----
From: Paul Harvey <paul_harv_2(_at_)yahoo(_dot_)com>
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Sent: Wed, 23 June, 2010 4:38:13 AM
Subject: Re: [xsl] 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">
<xsl:variable name="data">
<root>
<test>1000</test>
<test>2000</test>
<test>3000</test>
</root>
</xsl:variable>
<xsl:template match="/">
<xsl:for-each select="$data/root/test">
<xsl:for-each select="."/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
And I thought that with XSLT 1.1 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">
<xsl:variable name="data">
<root>
<test>1000</test>
<test>2000</test>
<test>3000</test>
</root>
</xsl:variable>
<xsl:template match="/">
<xsl:for-each select="exslt:node-set($data)/root/test">
<xsl:for-each select="."/>
</xsl:for-each>
</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
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--