In article <c0*************@ID-16539.news.uni-berlin.de>,
Tommy Frost <th***@t-online.de> wrote:
% >> <?xml version="1.0"?>
% >> <A xmlns1>
% >> <B xmlns2/>
% >> <C xmlns3>
% >> <D>xxx</D>
% >> </C>
% >> </A>
% >
% > That is not well-formed. Are you sure you understand XML namespaces at
% > all?
% >
http://www.w3.org/TR/REC-xml-names/
%
% As far as I know, wellformed means:
% - xml-declaration
[not required]
% - at least one element
% - one root-element
- every attribute has a value, in quotes
Let's guess at what you mean
<A xmlns='data:text/plain,my-namespace-1'>
<B xmlns='data:text/plain,my-namespace-2'>
<C xmlns='data:text/plain,my-namespace-3'>
<D>xxx</D>
</C>
</B>
</A>
and you want to know what name spaces apply to D. The answer is that
only 'data:text/plain,my namespace 3' does. In XSLT, you might get
at it like this
<xsl:template match='*[local-name() = "D"'>
<xsl:text>Namespace for D is </xsl:text>
<xsl:value-of select='concat(namespace-uri(), ".")'/>
</xsl:template>
If your goal is to force this to appear as an xmlns in the declaration of D,
I'm not sure it's possible to do that consistently.
--
Patrick TJ McPhee
East York Canada
pt**@interlog.com