Hi Gareth,
Thanks for your help.
BTW, it looks like the first parameter of DOMDocument::createAttributeNS()
have to be "http://www.w3.org/2000/xmlns/", otherwise an exception will
thrown :
**********************************************************************
const XMLCh* DOMNodeImpl::mapPrefix(const XMLCh *prefix,
const XMLCh *namespaceURI, short nType)
{
...
static const XMLCh s_xmlnsURI[] = // "http://www.w3.org/2000/xmlns/"
{ chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash,
chForwardSlash,
chLatin_w, chLatin_w, chLatin_w, chPeriod, chLatin_w, chDigit_3,
chPeriod,
chLatin_o, chLatin_r, chLatin_g, chForwardSlash,
chDigit_2, chDigit_0, chDigit_0, chDigit_0, chForwardSlash,
chLatin_x, chLatin_m, chLatin_l, chLatin_n, chLatin_s,
chForwardSlash, chNull};
...
if (XMLString::compareString(namespaceURI, s_xmlnsURI) == 0)
return s_xmlnsURI;
throw DOMException(DOMException::NAMESPACE_ERR, 0);
...
}
**********************************************************************
Best Regards
Lei
----- Original Message -----
From: "Gareth Reakes" <[EMAIL PROTECTED]>
To: "Xerces mailing list" <[EMAIL PROTECTED]>
Sent: Monday, February 03, 2003 6:39 PM
Subject: Re: How to add namspace mapping to DOM node?
> Hi,
> Namespace binding occurs at parse time so even if you do this it
> will not have any effect on eles/attrs prefixed with "D" in the scope of
> the ns attr. The DOMWriter is speced to "namespace normalize" a document.
> This means that it sorts all this stuff out and puts the appropriate
> prefixs etc in. This is not yet implemented.
> When you create your ns node are you going:
>
>
> DOMDocument::createAttributeNS("....", "xmlns:D") ?
>
>
> Gareth
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]