|
Subject: Re: [xsl] Accessing the source nodetree while in another context From: "Vasu Chakkera" <vasucv@xxxxxxxxxxx> Date: Wed, 20 Nov 2002 16:32:29 -0000 |
you can store the source document in a variable before your apply-template.
you can then refer to elements from the source xml through this variable
I think this should work
HTH
----- Original Message -----
From: "Jeff Rosler" <jeff.rosler@xxxxxxxxxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, November 20, 2002 3:45 PM
Subject: [xsl] Accessing the source nodetree while in another context
> Hi All,
>
> Can anyone tell me if there is a way to access the source nodetree while
> within another nodetree context? Here's a simple example -
>
> ...
> <xsl:variable name="mydoc" select="document('mydoc.xml')"/>
> <xsl:apply-templates select="$mydoc//*"/>
> ...
>
> While the apply-templates is run, the context for the current node is set
to
> $mydoc and any templates that are executed use that. If I want to access
the
> nodetree for the source document on which the transform was run, is there
a
> simple syntax to specify it? I see how I could do this if I used an
xsl:for
> as I could copy part of the source nodetree into a variable and just
access
> the variable, but it seems like if I want to use templates, they are going
> to be in a global scope and I won't be able to access my variable as it
> isn't in the same scope. Therefore, I would need some syntax to specify
the
> source nodetree directly.
>
> Thanks for any and all comments. Please let me know if I'm missing
something
> simple :-).
> Jeff Rosler
> Consultant
> Flatirons Solutions Corp
> 2555 55th Street
> Suite 100D
> Boulder, CO 80301
> 303-544-0514 x11
> jeff.rosler@xxxxxxxxxxxxxxxxxxxxxx
>
>
> 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] Accessing the source node, David Carlisle | Thread | RE: [xsl] Accessing the source node, Michael Kay |
| Re: [xsl] Accessing the source node, David Carlisle | Date | RE: [xsl] Accessing the source node, Michael Kay |
| Month |