[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Problem with using $variable in xsl:value-of
Hi folks, I want to use the value of a variable to define a path in XPath, but: - no way (the problem is marked --> PART A) -->This does not work--> why ??? <-- ============================= <xsl:variable name="t_path"> <xsl:value-of select="element[@name='module_active/status']"/> </xsl:variable> <xsl:value-of select="element[@name='content_group']/$t_path/@readonly"/> ============================= (you can find it in the complete source as well ) Does someone have any ideas. I think the solution might be simple, but I cannot grab it at the moment Thanks for your feedbacks Jochen from Berlin Sources: ======== Heres: xml: <?xml version="1.0"?> <module> <element name="content_group"> <in_process readonly="readonly"/> </element> <element name="module_active/status"> <value>in_process</value> </element> </module> Heres: xslt: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xhtml" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes" doctype-public="-//W3C/DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" standalone="yes" media-type="text/html" /> <xsl:template match="/module"> <xsl:variable name="t_path"> <xsl:value-of select="element[@name='module_active/status']"/> </xsl:variable> <br/> this works: <xsl:value-of select="element[@name='content_group']/in_process/@readonly"/> <!-- PART A - this is the part, I am frustrating about --> this not (why?): <xsl:value-of select="element[@name='content_group']/$t_path/@readonly"/> </xsl:template> </xsl:stylesheet> 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
|