control over location of namespace declarations in XSLT

  • Thread starter Christian Hoertnagl
  • Start date
C

Christian Hoertnagl

I have to create an XML document with repeating namespace definitions
such as:

<a xmlns:ns1="...">
<!-- ... -->
<b xmlns:ns1="...">
<!-- ... -->
</b>
</a>

This is required by the software that sees this output. My XSLT file
includes these definitions at the right places, but when I do a
transformation (with Java 1.4's Transformer class) the inner definition
is optimized away. Is there a way how I can preserve my declarations
exactly as specified in the XSTL document?

Thanks for any help,
Christian
 
M

Martin Honnen

Christian said:
I have to create an XML document with repeating namespace definitions
such as:

<a xmlns:ns1="...">
<!-- ... -->
<b xmlns:ns1="...">
<!-- ... -->
</b>
</a>

This is required by the software that sees this output. My XSLT file
includes these definitions at the right places, but when I do a
transformation (with Java 1.4's Transformer class) the inner definition
is optimized away. Is there a way how I can preserve my declarations
exactly as specified in the XSTL document?

I don't think so, when serializing XML it is allowed and quite common
the reduce xmlns attributes to the necessary minimum.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top