Subject: Re: [xsl] document tree fragments From: Joe Barwell <jbar@xxxxxxxx> Date: Mon, 13 Oct 2008 01:12:04 +1300 |
Is there a way to use my $thePath variable, instead of including the directory path inside the @filename attribute?
yes:
<docs path="jb"> <doc filename="wine1.xml" /> <doc filename="wine2.xml" /> <doc filename="wine3.xml" /> ... </docs>
<xsl:template match="docs"> <xsl:variable name="p" select="document(concat(@path,'/',doc[1]/@filename))"/> <xsl:variable name="z" select="document(doc/@filename,$p)"/> <xsl:for-each select="$z"> : <xsl:value-of select="."/> </xsl:for-each> </xsl:template>
puts all the document nodes in $z.
<xsl:variable name="thePath" select="document(concat(/docs/@path, '/', /docs/doc[1]/@filename))" /> <xsl:variable name="theWines" select="document(/docs/doc/@filename, $thePath)" />
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] document tree fragments, David Carlisle | Thread | [xsl] Re:Excluding a complete branc, Fraser Goffin |
[no subject], Unknown | Date | Re: [xsl] document tree fragments, Joe Barwell |
Month |