Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Parsing XML with namespace in IE. (getElementsByTagNameNS())

From: "Joe Fawcett" <joefawcett@-------.--->
To: NULL
Date: 11/4/2008 5:00:00 PM
"Steve" <stephen.joung@g...> wrote in message 
news:8e1bb314-c61c-4fdc-8d9f-fd228715dc75@p......
> With the help of this newsgroup and Google I have got this code
> working fully in Firefox and can alert the XML in IE but because IE
> does not impliment the DOM "getElementsByTagNameNS()" function I
> cannot read the individual rates from the Cube namespace.
>
> Is there a wrapper or some other relatively simple method of getting
> IE to do what in Firefox is straighforward?
>
You could always use XPath instead.
Instead of "Microsoft.XMLDOM" use "MSXML2.DomDocument.3.0".
The set the SelectionLanguage
doc1.setProperty("SelectionLanguage", "XPath")
then the namespace prefix:
doc1.setProperty("SelectionNamespaces", "xmlns:df = ''http://www.ecb.int/
vocabulary/2002-08-01/eurofxref'");

Then use XPath:
var cubes = doc1.selectNodes(<xpath expression here>);
If you show the XML I can tell you the XPath :)

-- 

Joe Fawcett (MVP - XML)

http://joe.fawcett.name




transparent
Print
Mail
Like It
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.

.
.

transparent

transparent