|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Re: Forcing namespaces to root element of output X
[removing xalan-j-users@xxxxxxxxxxxxxx from CC] > Unfortunately XSLT 1.0 doesn't have anything like an <xsl:namespace> > directive. The standard workarounds are to generate unnecessary attributes > in the desired namespaces to force their declaration (not acceptable for > many users), or to build a node in a Result Tree Fragment which uses the > namespace, then xsl:copy the namespace node off that RTF to put it where > you want it (obscure and a bit ugly, but pretty much a standardized > solution). XSLT 2.0 has promised to make this easier. You only need to do this though if the namespace is not known at the time the stylesheet is written. If it is a fixed namespace known in the stylesheet you don't need the (missing) xsl:namespace functionality, just declare the namespace (eg on xsl: stylesheet) and then use a literal result element rather than xsl:element to generate the top level element. A common reason for wanting to use xsl:element rather than a literal result element is to stop this namespace copying in cases where you don't want the namespace in the result. 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
|

Cart








