[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
How_To_XML_Display_XML_In_HTML_DataIslands
The XML data can be embedded directly between <xml></xml> tags in an HTML page, or can be loaded from an external XML file.
Use the src attribute of the <xml> tag to refer to a local XML file.
The <xml> HTML tag is used to create an XML Data Island.
The ID attribute given in the <xml> tag is used to reference the data island and it must match the value of the datsrc attribute of HTML elements, that can accept data source tags.
A list of such HTML elements: <a>, <applet>, <button>, <div>, <frame>, <iframe>, <img>, <label>, <marquee>, <select>, <span>, <table>, <textarea>, and the <input> tags (button, checkbox, hidden, image, password, radio, text). To bind your XML data to an HTML element, add the data source and data field attributes to the HTML element. The datasrc attribute refers to the id attribute of the xml tag preceded by the # sign.
Note that the <span> tag, like most HTML elements, will only display a single record.
XML FAQ
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
How_To_XML_Display_XML_In_HTML_DataIslands
How to display XML elements in HTML using Data Islands?
?Data Islands is a ?client-side Internet Explorer 5.0+ only technology in which you can bind XML data to HTML tags and display the results in an HTML page.The XML data can be embedded directly between <xml></xml> tags in an HTML page, or can be loaded from an external XML file.
<xml id="books"> <?xml version="1.0"?> <books> <book> <title>OpenGL Programming Guide Fourth Edition</title> <location>107</location> <publisher>Addison-Wesley</publisher> <year>2004</year> </book> <book> <title>Curves and Surfaces for CAGD: A Practical Guide</title> <location>116</location> <publisher>Academic Press</publisher> <year>2002</year> </book> <book> <title>An Introduction to NURBS: With Historical Perspective</title> <location>120</location> <publisher>Academic Press</publisher> <year>2001</year> </book> <book> <title>NURBS: From Projective Geometry to Practical Use</title> <location>126</location> <publisher>A K Peters</publisher> <year>1999</year> </book> </books> </xml>
Use the src attribute of the <xml> tag to refer to a local XML file.
<xml ID="books" src="books.xml"></xml>
The <xml> HTML tag is used to create an XML Data Island.
The ID attribute given in the <xml> tag is used to reference the data island and it must match the value of the datsrc attribute of HTML elements, that can accept data source tags.
A list of such HTML elements: <a>, <applet>, <button>, <div>, <frame>, <iframe>, <img>, <label>, <marquee>, <select>, <span>, <table>, <textarea>, and the <input> tags (button, checkbox, hidden, image, password, radio, text). To bind your XML data to an HTML element, add the data source and data field attributes to the HTML element. The datasrc attribute refers to the id attribute of the xml tag preceded by the # sign.
<br />Title: <span datasrc="#books" datafld="title"></span> <br />Location: <span datasrc="#books" datafld="location"></span> <br />Publisher: <span datasrc="#books" datafld="publisher"></span> <br />Year: <span datasrc="#books" datafld="year"></span>
Note that the <span> tag, like most HTML elements, will only display a single record.
XML FAQ
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
