|
Subject: Re: [xsl] after use of document(): selecting parts of the obtained node-set From: Chuck White <chuckwh@xxxxxxxxxxx> Date: Thu, 11 Apr 2002 15:27:54 -0700 |
Could be a couple things. One, it should be:
document('itn.xml')
Note the single quotes.
Without the quotes, the XSLT processor thinks your argument is a node-set,
not a string value of the resource.
And logo is a child of itn, so it should be:
<xsl:apply-templates select="$itn/itn/logo" />
best regards,
Charles White
The Tumeric Partnership
http://www.tumeric.net
chuck@xxxxxxxxxxx
________________________________________
Author, Mastering XSLT
Sybex Books, May, 2002
Co-Author, Mastering XML, Premium Edition
Sybex Books, May, 2001
http://www.javertising.com
----- Original Message -----
From: "Ralph Holz" <Ralph.Holz@xxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, April 11, 2002 3:04 PM
Subject: [xsl] after use of document(): selecting parts of the obtained
node-set
> 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
>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] after use of document(): , Ralph Holz | Thread | [xsl] Copying attribute value, Uslu, Cihan Y (MED) |
| Re: [xsl] after use of document(): , Joerg Heinicke | Date | RE: [xsl] variable in xpath?, Steve Renshaw |
| Month |