he XML Data Source Object (DSO) is a Microsoft ActiveX control that’s been built into Microsoft Internet Explorer since version 4. This object allows you to extract content from an external XML file or XML data embedded in the HTML file into a HTML page.
You can use the XML-DSO in a Web page to extract content from an external XML file, extract XML data from XML data embedded in the Web page, and manipulate that data using JavaScript. However, it is not advisable to use this object for the Internet since XML-DSO only works on MSIE 4+ browsers, which can raise compatibility issues. It is much more advisable to use XML-DSO for intranets.
Getting Started
To initialize the XML-DSO object, use the
CLSID:550dda30-0541-11d2-9ca9-0060b0ec3d39
This ID uniquely identifies the XML-DSO. Initialize this control in a Web page using this code:
Though most OBJECTs have a number of parameters associated with them, the XML-DSO does not require any.
Extract Data Using an XML Data Island Note that the code does not initialize an XML-DSO object. This is because the use of an XML data island implicitly creates one. The output should be: Note that there are two The output should be: Name Sex Premshree Pillai male Vinod male In Listing 2, the Extract Data Using an External XML File First create an XML-DSO object, with the ID myXML. Add the width and height attributes to the Next, create a table with datasrc as myXML?similar to Listing 2. The code extracts the data using
First, include an XML data island by using the Premshree Pillaimale
tag:
tag extracts data using
tag. The table will automatically iterate through each instance of
To load an external XML file using XML-DSO, you have to explicitly include the object and use a small bit of JavaScript.
Message URL