Altova Mailing List Archives


Re: MsXml Namespace - using them

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


"Ariel" <a@a...> wrote in message 
news:eSZoadf3GHA.4748@T......
> Hello. I first declare a namespace in my IXmlDomDocument:
>
>    URI = 'http://domain.com';
>    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:

http://groups.google.co.uk/group/microsoft.public.xml/browse_thread/thread/ae7d7bdffc7130af/d2bdf2bab4a28033?&hl=en#d2bdf2bab4a28033

Basically the namespace to provide is the namespace mapped to xmlns 
(http://www.w3.org/2000/xmlns/), you seem to be supplying the nodeValue.


-- 

Joe Fawcett -  XML MVP


http://joe.fawcett.name 


Disclaimer

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 www.altova.com/list/index.html. 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.