Altova Mailing List Archives

Re: MsXml Namespace - using them

From: "Joe Fawcett" <joefawcett@---------.------>
Date: 9/22/2006 9:13:00 AM

"Ariel" <a@a...> wrote in message 
> Hello. I first declare a namespace in my IXmlDomDocument:
>    URI = '';
>    n = ownerDocument.createNode(NODE_ATTRIBUTE,'xmlns:fe',URI);
>    n.nodeValue = URI;
>    node.setAttributeNode(n);
> then when I want to use that namespace, I use:
>    n2 = ownerDocument.createNode(NODE_ATTRIBUTE, 'name', URI);
>    n2.nodeValue = 'value';
>    node.setAttributeNode(n2);
> the problem is that n2 in the xml doesn't have the "fe:" prefix, it is
> something like "name=value" (without the "fe" prefix).
> How can I use a declared namespace in a new attribute or a new element?
> Thanks,
> Ariel
> -- 
If you are trying to create a namespace declaration then see this thread:

Basically the namespace to provide is the namespace mapped to xmlns 
(, you seem to be supplying the nodeValue.


Joe Fawcett -  XML MVP 


These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.