Re: XML Data Island
From: Joe Fawcett (joefawcett_at_newsgroups.nospam)
Date: 03/24/05
- Next message: Kathleen L.: "Re: Access is denied with window.open"
- Previous message: Brian Staff: "Re: XML Data Island"
- In reply to: Brian Staff: "Re: XML Data Island"
- Next in thread: Martin Honnen: "Re: XML Data Island"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 24 Mar 2005 15:59:18 -0000
"Brian Staff" <brianstaff@[NoSpam]cox.net> wrote in message
news:XcB0e.412$k57.279@fed1read07...
> OK...at my age, sometimes you need to be told things twice<g>
> Anyway, I am now using a pseudo data island with a javascript VARiable which
> is actually a copy of the returned responseXML for the XMLHTTP request.
>
> It all works...except, I am still having a problem with namespaces. The
> returned XML does have a declartion in it for the "ds" and "z" namespaces, but
> FF will not work with this type of code:
>
> rows = fieldXMLIsland.getElementsByTagName("z:row");
> IE does work
>
> FF does work with this:
> rows = fieldXMLIsland.getElementsByTagName("row");
> but then IE fails
>
> is there anywhere else I need to declare the namespace, apart from inside the
> XML structure.
>
> Thanks for your patience - Brian
If the returned XML deos not have dclarations for the ds and z namespace
prefixes then it's not XML.
In any case you'd be better off using XPath rather than DOM select methods. In
IE you set the namespace and prefix first:
objDom.setproperty("SelectionLanguage", "XPath");
objDom.setProperty("SelectionNamespaces", "xmlns:ds='<uri goes here>'
xmlns:z='<uri goes here>'");
var sXPath = "/*/z:row"; //This is probably wrong but I haven't seen your XML
var colNodes = objDom.selectNodes(sXPath);
You'll have to look at the comparable methoid for Mozilla XPath usage.
As I said using Sarissa relieves you of some of these headaches.
-- Joe (MVP - XML) .
- Next message: Kathleen L.: "Re: Access is denied with window.open"
- Previous message: Brian Staff: "Re: XML Data Island"
- In reply to: Brian Staff: "Re: XML Data Island"
- Next in thread: Martin Honnen: "Re: XML Data Island"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|