[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: invalid xpath expression
[abbouh] > my xsl file is: > > <xsl:choose> > <xsl:when test=".=list"> > <xsl:variable name="n" select="12"/> > </xsl:when> > <xsl:otherwise> > <xsl:variable name="n" select="2"/> > </xsl:otherwise> > </xsl:choose> > ------------------- > <xsl:variable name="m" select="$n"/> > > i receive the error :invalid xpath expression! > so what the problem in <xsl:variable name="m" select="$n"/>? The variable $n only exists in the scope of the block in which it is defined. It is not known outside that block. So it is not known outside the xsl:othewise block. You just have to put the whole xsl:choose block inside the variable declaration. Then the variable will be visible. I think you meant select="'12'", did you not? Otherwise select will be looking for a node named 12, and there can not be such a node, since it is an illegal name for an xml element.. Cheers, Tom P 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
|