Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XML Data Island and XMLHttpRequest

From: "Joe Fawcett" <joefawcett@---------.------>
To: 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




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