Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - XML Data Island and XMLHttpRequest [Thread Next] Re: XML Data Island and XMLHttpRequestTo: NULL Date: 1/5/2006 9:03:00 AM <joshis@g...> wrote in message
news:1136437861.120795.163450@g......
> Hi all,
>
> Is there a simple way to make a data island dynamic using
> XMLHttpRequest?
>
> Currently I have a very simple data island setup populating the html
> table from an xml file. Is there an easy way to do this? From what I
> have read it should be possible with XMLHttpRequest but I have not used
> it before, I have played around with it and could not get any response
> from the xml file. Maybe there is something I'm not doing right because
> it is a local file?
>
> any help would be much appreciated.
>
> thanks,
>
> Josh
>
> Current Data island code:
>
>
> <xml id="ccrr" src="ccrr.xml"></xml>
> <body>
>
> <TABLE datasrc="#ccrr">
> <CAPTION><H1>Register<img src="pawt.jpg" width=130
> height=86></img></H1></CAPTION>
> <THEAD><TD>ID<TD>Date<TD>Policy Number<TD>Policy Name<TD>Attn:<TD>Time
> of Call<TD>Fax Number<TD>Taken By<TD>Notes</TR></THEAD>
> <TR>
> <TH><span datafld="IDNO"></span></TH>
> <TH><span datafld="DATE"></span></TH>
> <TH><span datafld="POLN"></span></TH>
> <TH><span datafld="NAME"></span></TH>
> <TH><span datafld="ATTN"></span></TH>
> <TH><span datafld="TIME"></span></TH>
> <TH><span datafld="FAXN"></span></TH>
> <TH><span datafld="USER"></span></TH>
> <TH><span datafld="NOTE"></span></TH>
>
> </TR></TABLE>
> </BODY>
> </HTML>
>
In theory you can but I've struggled in the past to get the island to
refresh.
You can use something like:
document.getElementById("ccrr").XMLDocument.load(<xml dom here>);
and then remove the table's datasrc and then reset it, giving the table an
id of "tblXmldata":
var oTable = document.getElementById("tblXmldata");
oTable.removeAttribute("dataSrc", 0);
oTable.setattribute("dataSrc", "#ccrr");
As I said I've had mixed success with this and usually ended up doing my own
databinding using the XML rather than the built-in version.
--
Joe Fawcett (MVP - XML)
https://mvp.support.microsoft.com/profile=8AA9D5F5-E1C2-44C7-BCE8-8741D22D17A5
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
