Subject: Re: [xsl] Extracting hypertext attribut value of an xsl document From: "frank Stein" <freeposte@xxxxxxxxxxx> Date: Tue, 30 Jan 2001 17:28:43 |
Hello David, here goes a corrected and simpler example of my request.
<a href="javascript:void(0)" Name="linkName">link</a> <xsl:variable name="my_var"><xsl:value-of select=...?></xsl:variable>
From: David Carlisle <davidc@xxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx CC: XML-L@xxxxxxxxxxxxxxxxxx Subject: Re: [xsl] Extracting hypertext attribut value of an xsl document Date: Mon, 29 Jan 2001 18:28:30 GMT
> Please could you give me a hand on this one ?
You might need to be more specific about what you are trying to do.
> I would like to extract out the attribute value of an hypertext tag in order
> to affect it to on an XSL variable.
>
> Example:
>
> <xsl:template match="RootLevel">
> <a href="javascript:void(0)">
> <xsl:attribute name="Name">
> <xsl:value-of select="my_name"/>
> </xsl:attribute>
>
> <xsl:variable name="my_var">
> <xsl:value-of select="(here goes the hypertext Name attribute
> value)"/>
I'm not sure what you mean here, but the Name attribute in the result tree wiill have the value returned by <xsl:value-of select="my_name"/> so it would appear that you could use that (but I suspect you mean something else?)
> </xsl:variable> > </a> > > <xsl:apply-templates select="Level[@Name=$my_var]"/>
This will generate an error as the my_var variable is defined inside the <a> element above, and so is local to that literal result element, but this line is after th eclosing </a>.
> </xsl:template>
>
> How do you "call" the attribut "Name" containing "my_var" and then how
> should the value "my_var" be extracted ?
>
> Thank-You.
>
> Ovide.
<xsl:template match="RootLevel"> <a href="javascript:void(0)" Name="{my_name}"/> <xsl:apply-templates select="Level[@Name=my_name]"/>
is syntactically correct but it's hard to know if that's what you want without any idea of the input file or the required output.
This presumes an input dsocument that looks like
<RootLevel> <my_name>xxx</xxx> ... <Level Name="xxx"> ... </Level> </RootLevel>
and an output that looks like
<a href="javascript:void(0)" Name="xxx"/> ...
David
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
_________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Extracting hypertext attr, David Carlisle | Thread | Re: [xsl] Extracting hypertext attr, David Carlisle |
Re: [xsl] dealing with doctype dtd', Bob DuCharme | Date | [xsl] Re: recursion questions, Robert Koberg |
Month |