[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: namespace declaration missing in output
Hi Philip, > We do have a workaround by now, using > <xsl:attribute name="objectID" namespace="http://www.fiscus.de">, > but that generates lots of ns0, ns1, ns2 namespaces. > It works, but it is not very nice. I think that the problem you reported might be a bug with the version of Xalan you're using - certainly Saxon gives you the result that you expect. Given your workaround, you could try to give a prefixed name for the attribute as well as the namespace: <xsl:attribute name="fiscus:objectID" namespace="http://www.fiscus.de">, and Xalan *might* use that prefix rather than 'ns0' and so on. Another workaround is to actually create a new element rather than copying the element from the result tree, i.e.: <xsl:template match="*"> <xsl:element name="{name()}"> <xsl:attribute name="fiscus:objectID""> <xsl:number level="any" count="*"/> </xsl:attribute> <xsl:apply-templates select="@*|node()|comment()|processing-instruction()"/> </xsl:element> </xsl:template> I *think* that the element that's created will have to have all the namespaces nodes on it that are on the xsl:element instruction (i.e. all those in effect for the stylesheet as a whole) aside from those that are explicitly ignored (i.e. the XML and XSLT namespaces, and any that are declared as extension element namespaces or namespaces to be omitted from the result tree). Worth a go, anyway :) I hope that helps, Jeni --- Jeni Tennison http://www.jenitennison.com/ 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
|