[xsl] after use of document(): selecting parts of the obtained node-set

Subject: [xsl] after use of document(): selecting parts of the obtained node-set
From: Ralph Holz <Ralph.Holz@xxxxxxxxxx>
Date: Thu, 11 Apr 2002 23:04:27 +0100
Hi,

first, thanks to all the people who helped me with my problems the last few days!

Unfortunately, I've got a new one:

I use the document function to load a document from within a stylesheet, and store the resulting nodeset in a variable:

<xsl:variable name="itn" select="document(itn.xml)" />

I believe this works. The variable is top-level, by the way.

The document itn.xml has the following structure:

<itn>
	<logo>
		some child elements
	</logo>
	
	<menu>
		some child element
	</menu>
</itn>

Now I'd like to access certain parts of this nodeset, like this:

<xsl:template>

...

<xsl:apply-templates select="$itn/logo" />

...

</xsl:template>

and for the sub-nodeset $itn/logo I have the following template:

<xsl:template match="itn/logo">
	extract data
</xsl>

Unfortunately, whenever I try this combination, the result of my <xsl:apply-templates select="$itn/logo"> is empty. The same is true when I do a select like <xsl:apply-templates select="$itn//logo">.

Maybe I haven't understood the functionality of document() or how to access parts of a node set that is returned by document()? Can someone help me, please?

Thanks a lot,
Ralph


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread