How to embed XML data in an HTML page

Embedding xml data in an html page can be done through a concept called data islands. These are supported by the <xml> tag that is used to embed the data source in the html file. For example if you are going to embed an xml file called books.xml in to an html page then, you can use a code similar to,

_______________________________________________


_______________________________________________

<xml id="bksrc" src="books.xml"></xml>

After writing this code the contents of the books.xml file is embedded in the html page. But this content is not visible to the use at present. You have to write the code to display the content that is embedded in the web page. You can do so by,

<table border="1" datasrc="#bksrc">
<tr>
<td><span datafld="author"></span></td>
<td><span datafld="title"></span></td>
</tr>
</table>

The above table uses the datasrc as the id given in the xml tag so that the content of the books.xml file is available to the table. The datafld attribute is used in the <span> tag to display text in the author and the title elements in the xml file.

What to expect from HTML 5 (InfoWorld via Yahoo! News)
Among Web developers, anticipation is mounting for HTML 5, the overhaul of the Web markup language currently under way at the Worldwide Web Consortium (W3C). For many, the revamping is long overdue. HTML hasn't had a proper upgrade in more than a decade. In fact, the last markup language to win W3C Recommendation status -- the final stage of the Web standards process -- was XHTML 1.1 in 2001.



FREE Subscription

Subscribe to our mailing list and receive new articles
through email. Keep yourself updated with latest
developments in the industry.

Name:
Email:

Note : We never rent, trade, or sell my email lists to
anyone. We assure that your privacy is respected
and protected.

_______________________________________

Recommended XML Books

cover
cover
cover
cover
cover
cover





 

 

FREE Subscription

Stay Current With the Latest Technology Developments Realted to XML. Signup for Our Newsletter and Receive New Articles Through Email.

Name:

Email:

Note : We never rent, trade, or sell our email lists to anyone. We assure that your privacy is respected and protected.

 

 

Add to My Yahoo!


New XML Books Titles - Best Seller's @ Amazon.com

Visit XML Training Material Guide Homepage

Technology helps engage students - how do classroom instruction and social dynamics change when the classroom is completely dependant on modern technology?

Cisco CCNA Certification Video Tutorial Guide - Learn How to Pass the Cisco CCNA 640-802 Exam... Guaranteed!

Train Signal Computer Training