Michael Burek wrote:
In the output document below I want the
xmlns:gco="http://www.isotc211.org/2005/gco namespace declaration to
appear in the MD_Metadata root element, not in the CharacterString
child element(s)
[...]
<xsl:element name="MD_Metadata" >
Change this to <MD_Metadata> and remove the <xsl:namespace> instruction.
There are many CharacterString and other gco namespace elements in the
real output document, so having the namespace in each is undesirable.
That's understandable, but it does not differ for any namespace aware
processor.
There is a very simple trick you can employ: every non-xsl element will
become a part of your literal result tree, automatically. These literal
elements inherit the namespace from there parents. By defining your very
first element as literal result tree element (see above), it will
receive all the namespaces (and normally the same prefixes too, but that
is not guaranteed) of the root xsl:stylesheet instruction. This will
include the GCO namespace.
I believe this behavior is not guaranteed so in theory, but it is the
way I see it happening in practice.
To suppress certain namespaces, you can employ exclude-result-prefixes
on xsl:stylesheet.
HtH,
Cheers,
-- Abel Braaksma
http://www.nuntia.com
--~------------------------------------------------------------------
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>
--~--