xsl-list
[Top] [All Lists]

Re: [xsl] Controlling namespace in output

2010-12-16 22:37:02
That sounds like an excellent solution. Can you give an example of how
I can add the namespace to the stylesheet so that all elements are
generated in the DocBook namespace?

Thanks.

Peter

On Thu, Dec 16, 2010 at 6:32 PM, David Carlisle 
<davidc(_at_)nag(_dot_)co(_dot_)uk> wrote:
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.

David



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>