[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Identity transform (case conversion)
Hi Mukul,
You need the node-set extension I think. Change your template that matches elements like below: <xsl:template match="*"> <xsl:element name="{translate(name(), $small, $caps)}" namespace="{translate(namespace-uri(), $small, $caps)}"> <xsl:variable name="currentNamepsace" select="namespace-uri()"/> <xsl:variable name="nsHolder"> <test> <xsl:for-each select="current()//namespace::*[not(.=$currentNamepsace) and not(name()='xml')]" > <xsl:attribute name="{translate(name(), $small, $caps)}:dummy{position()}" namespace="{translate(., $small, $caps)}"></xsl:attribute> </xsl:for-each> </test> </xsl:variable> <xsl:copy-of select="exslt:node-set($nsHolder)/test/namespace::*"/> <xsl:apply-templates select="@*"/> <xsl:apply-templates/> </xsl:element> </xsl:template> and add xmlns:exslt="http://exslt.org/common" exclude-result-prefixes="exslt" on the stylesheet element. Basically you need to create new namespace nodes and copy them instead of the old namespaces and also you need to change the namespace of the created elements and attributes (so you have to change accordingly the template that handles your attributes). Best Regards, George --------------------------------------------------------------------- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com Mukul Gandhi wrote: Hello All, I am trying to write a XSLT stylesheet (I am seeking both 1.0 and 2.0 solutions. If extensions are unavoidable, I can use them) which will take as input any XML document, and produce as output, a XML document which is an identity of the input (i.e. what is produced by the identity transform). But the condition is: all the letters (a-z) anywhere in source XML should change from small case to capitals.
|
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
|