This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: after use of document(): selecting parts of the obtainednode-set


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@tumeric.net
________________________________________
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@unique.com>
To: <xsl-list@lists.mulberrytech.com>
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]