[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Extracting hypertext attribut value of an xsl docu
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|