[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Re: xsl:namespace
Thanks. I have made a stylesheet example illustrating MK's additional use case. Below, xsl:namespace is used to transfer namespace declarations from children elements to outermost element in output. This is only for cosmetic reasons, to clean things up, but very nice. I have a feeling that for this use case it is only necessary for dynamically created namespaces. It seems to me that as long as we can put the proper namespace declarations in the xsl:stylesheet element, they always show up in the outermost element of output unless we exclude them? <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes"/> <xsl:param name="ns-prefix" select="'somePrefix'"/> <xsl:param name="ns-namespace" select="'someNamespace'"/> <xsl:template name="start" match="/"> <catalog> <xsl:namespace name="{$ns-prefix}" select="$ns-namespace"/> <xsl:element name="{$ns-prefix}:product" namespace="{$ns-namespace}"/> <xsl:element name="{$ns-prefix}:product" namespace="{$ns-namespace}"/> </catalog> </xsl:template> </xsl:stylesheet> Cheers, Jesper Tverskov http://www.xmlkurser.dk http://www.xmlplease.com
|
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
|