embed XML in HTML ....

Status
Not open for further replies.

iinfi

mekalodu
i got these 2 files frm w3schools.com

embedXML.html
<html>
<body>

<xml id="cdcat" src="cd_catalog.xml"></xml>

<table border="1" datasrc="#cdcat">
<tr>
<td><span datafld="ARTIST"></span></td>
<td><span datafld="TITLE"></span></td>
<td><span datafld="PRICE"></span></td>
</tr>
</table>

</body>
</html>


cd_catalog.xml
<?xml version="1.0" encoding="ISO-8859-1"?>

<CATALOG>
<CD>
<TITLE>Empire Burlesque</TITLE>
<ARTIST>Bob Dylan</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Columbia</COMPANY>
<PRICE>10.90</PRICE>
<YEAR>1985</YEAR>
</CD>
<CD>
<TITLE>Hide your heart</TITLE>
<ARTIST>Bonnie Tyler</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>CBS Records</COMPANY>
<PRICE>9.90</PRICE>
<YEAR>1988</YEAR>
</CD>
</CATALOG>


copied both the files in the same folder .... Internet Explorer displays the HTML file in a table consisting of ARTIST, TITLE AND PRICE.
while Firefox doesnot display a table consisting of the XML data ... as Firefox does not support XML embedded in HTML as Data Islands

my question is why do browsers other than IE dont support XML embedded in HTML as Data Islands??
 

icecoolz

Cyborg Agent
probably because it is not a standard. Most browsers support standards and hence it becomes easier for applications to be developed which will follow those standards. Which will enable the end users to use browsers of their choice.
 
OP
iinfi

iinfi

mekalodu
but its quite helpful in displying items in tables in a browser using simple HTML ... then why are other browsers not supporting it ?
 
Status
Not open for further replies.
Top Bottom