How to embed XML data in an HTML pageEmbedding 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"> 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.
|
|
||
|
|||
“Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.”
Copyright - © 2004 - 2019 - All Rights Reserved.