This page has been robot translated, sorry for typos if any. Original content here.

XML inside HTML

One practical way to use XML is to use XML within an HTML document. This process is called binding. The easiest way to include XML inside an HTML document. This is done using the XML tag and the document ID. This identifier will later be useful for displaying the document. And then you need to link the data in XML with the HTML document.

In the example below, a table is created that displays the data.

We are looking at the code:

  <html>
 <BODY>
 <h2> Hello XML </ h2>

	 <XML ID = "xmlSteps">
	 <? xml version = "1.0"?>
	 <steps>
		 <step>
			 <name> Step1 </ name>
				
		 </ step>
		 <step>
			 <name> Step2 </ name>
				
		 </ step>
		 <step>
			 <name> Step3 </ name>
				
		 </ step>
	 </ steps>
	 </ XML>

 <table datasrc = "# xmlSteps">
 <tr>
	 <td> <div datafld = "name"> </ div> </ td>
 </ tr>
 </ table>

And here is the result:

XML внутри HTML