Unfortunately, JSTL does not currently do a good job at handling namespaces within XPath expressions.
Have a look at the following thread for the details: http://nagoya.apache.org/eyebrowse/ReadMsg?listName=taglibs-user@;jakarta.apache.org&msgNo=3914 The Expert Group is currently looking at a solution for this for JSTL 1.1. In the meantime, you'll have to resort to using namespace-uri() in your XPath expressions to be able to select elements whose QName includes a namespace prefix. -- Pierre Gisella Saavedra wrote: > > Hello, > > can anyone offer any help on what follows: > > I have the following file, colors.xsl, which I read as xml input although it is a >stylesheet: > > <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> > <xsl:variable name="dark" select="'#990000'">ciao</xsl:variable> > <xsl:variable name="medium" select="'#B3B697'">hola</xsl:variable> > <xsl:variable name="light" select="'#EDEBEB'"/> > </xsl:stylesheet> > > I basically need to set background colors for a JSP-based application. > What I do is to set application variables containing the color values. > This file is read once, at application login. > > I have the following piece of code WHICH WORKS when I remove the namespace > prefixes from colors.xsl: > > <c:import var="colors" url="/mwr/colors.xsl"/> > <x:parse xml="${colors}" var="colorsXml"/> > <x:set var="mediumColor" scope="application" > select="string($colorsXml//stylesheet/variable[@name='medium']/@select)" /> > ... > > Does somebody know how I can handle the namespace prefix "xls" in the > "select" attribute of x:set? > I tried: > <x:set var="darkColor" scope="application" > select="string($colorsXml//@*[local-name() = 'dark']/@select)" /> > > but it does not retrieve anything > ?? > > Gisella > > -- > To unsubscribe, e-mail: <mailto:taglibs-user-unsubscribe@;jakarta.apache.org> > For additional commands, e-mail: <mailto:taglibs-user-help@;jakarta.apache.org> -- To unsubscribe, e-mail: <mailto:taglibs-user-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:taglibs-user-help@;jakarta.apache.org>
