[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSLT test of xsl variable problem
PS you don't show your input format so perhaps this is OK but all your templates of the form <xsl:template match="orion-web-app[@internationalize-resources]"> <xsl:if test="internationalize-resources"> <xsl:copy> <xsl:attribute name="internationalize-resources">:[value]</xsl:attribute> <xsl:apply-templates select="@*[not(name()='internationalize-resources')]"/> <xsl:call-template name="copy-content-no-attrs"/> </xsl:copy> look rather strange. eg this one matches orion-web-app elements if they have a internationalize-resources attribute, but never uses that attribute but rather tests to see if there is a child element of that name. If there is such an element it generates an attribute called internationalize-resources with value :[value] I would have guessed that you meant <xsl:if test="@internationalize-resources"> to test for an attribute, but then the test would be pointless as youknow the element has such an attribute as it is in the match pattern. So assuming you did mean to test for both element and attribute, the above could more simply be written <xsl:template match="orion-web-app[internationalize-resources and @internationalize-resources]"> <orion-web-app internationalize-resources=":[value]"> <xsl:copy select="@*[not(name()='internationalize-resources')]"/> <xsl:apply-templates/> </orion-web-app> </xsl:template> probably this template could also be combined with all teh others that have similar format, but it depends a bit what you are trying to do. Do you really need this :[value] substitution stuff? why not handle that all in XSLT? David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
|
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
|