Re: Controlling namespace in output
On 16/12/2010 23:27, Peter Desjardins wrote: > I added the DocBook namespace to the root element of my output. Why do > its children have null namespaces (xmlns="")? How can I prevent them > from having explicit namespaces?
you have generated the root element in the namespace but all the other elements in no-namespace so the serialiser has to add xmlns=""
The solution is to generate all eleemnts in the docbook namespace, then the serialiser will just put a single declaration on the outmost element.
the easiest way to do that (usually, it depends a bit on your code) is to move xmlns="..." from where you have it on to xsl:stylesheet so it is in scope for the whole stylesheet.
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