This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: selecting an element in an external doc using its id attribute
- From: Jarkko dot Moilanen at uta dot fi
- To: xsl-list at lists dot mulberrytech dot com
- Date: Tue, 18 Jun 2002 07:51:44 +0300 (EEST)
- Subject: Re: [xsl] selecting an element in an external doc using its id attribute
- References: <94290089927.20020617172118@virginia.edu>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Lainaus Cindy Mazza <clm6u@virginia.edu>:
> 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>
>
Sorry, if I dont understand this correctly, but error is that U are
looking /selecting the value of id elements from attribute. Is this
what U really want? It would help to see the xml file (atleast for me).
Jeni, Michael, some other guru could correct me if I´m wrong.
Cheers
Jarkko
> 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
>
>
******************************************************************
Jarkko Moilanen *You are wise, witty, and wonderful, *
Researcher/ ITCM *but you spend too much time *
jm60697@uta.fi *reading this sort of trash. *
www.uta.fi/~jm60697 * *
GSM: +358 50 3766 927 * *
******************************************************************
* ITCM | Information Technology and Crisis Management *
* http://www.itcm.org *
******************************************************************
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list