> - get rid of unused namespaces by using exclude-result-prefixes on the 
> stylesheet
> - if you create an element in a certain namespace, you can _not_ change the 
> namespace later on as the namespace have become an integral part of the  
> element.
I'm already using exclude-result-prefixes. Also, this is not an
"elements created in a certain namespace problem", I think.
Here's an example:

XML document:
<?xml version="1.0" encoding="UTF-8"?>
<my:entry xmlns:my="http://mynamespace.org/";
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
          xsi:schemaLocation="test.xsd">
<my:content xmlns="http://www.w3.org/1999/xhtml";>
<h1>example data</h1>
<p>hello there</p>
<p>and one more</p>
</my:content>
</my:entry>

When I deep-copy the insides of this thing's <content> element,  I get
something like this:
<h1 xmlns:my="http://mynamespace.org/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>example
data</h1>
<p xmlns:my="http://mynamespace.org/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>hello there</p>
<p xmlns:my="http://mynamespace.org/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>and one more</p>

>From what I believe, the xhtml elements inside content are in the
default (xhtml) namespace, and not in the my: and neither in the xsi:
namespace.Also, the xmlns:* 'attributes' are just hints and are in no
way related to the actual namespace the elements are in. The element
name prefix does that.

So anyways, the above is what I get if I don't use an identity
transformation that strips namespaces. My original question was
whether there is a cleaner solution than copying (manual, recursive,
likely slower than the built-in xsl:copy-of operation) to remove these
redundant namespace declarations from the xhtml output.
_______________________________________________
xslt mailing list, project page http://xmlsoft.org/XSLT/
[email protected]
http://mail.gnome.org/mailman/listinfo/xslt

Reply via email to