This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
selecting an element in an external doc using its id attribute
- From: Cindy Mazza <clm6u at virginia dot edu>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Mon, 17 Jun 2002 17:21:18 -0400
- Subject: [xsl] selecting an element in an external doc using its id attribute
- Organization: IATH
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi ,
The following code gets me the first div3 element w/in the odes document
(as expected):
<xsl:variable name="from" select="@from"/>
<xsl:variable name="docnode" select="document('../texts/odes.xml')"/>
<xsl:message>
<xsl:value-of select="$docnode//div3"/>
</xsl:message>
But when I try to find an element whose id attribute is equal to the
value of the 'from' variable, I get an error saying "Unexpected token
[<function>] in path expression."
<xsl:variable name="from" select="@from"/>
<xsl:variable name="docnode" select="document('../texts/odes.xml')"/>
<xsl:message>
<xsl:value-of select="$docnode//id($from)"/>
</xsl:message>
Is it possible to do it this way, or do I need to go about it
differently? Either way, I'd appreciate any help.
Thanks.
-----
- Cindy
Cynthia L. Mazza
mailto:clm6u@virginia.edu
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list