As the following code details, HTML references XML data island, how to cross the tree structure of the relationship? I don't know how to use the tag name in XML inside this datafld, how to prefix it, how to get the name child element from resume, and how should my HTML file be modified?
The XML data file is:
XML Code:
Copy Code code as follows:
<?xml version= "1.0" encoding= "UTF-8"?>
<resume>
<name>mike</name>
<age>29</age>
</resume>
The HTML file is the following:
HTML Code:
Copy Code code as follows:
<body>
<xml id= "myds" src= "Kg.xml" ></XML>
<table datasrc= "myDS" >
<tr>
<td><div datafld= "Resume:name"/></div></td>
<td><div datafld= "Name"/></div></td>
<td><div datafld= "Age"/></div></td>
</tr>
</table>
</body>
To avoid the above problems, there are two points to be modified:
1. datasrc= "# Here I'm missing #
2. span must be used.
The following are the exact code details modified:
XML Code:
Copy Code code as follows:
<?xml version= "1.0" encoding= "UTF-8"?>
<resume>
<name>mike</name>
<age>29</age>
</resume>
HTML Code:
Copy Code code as follows:
<xml id= "XMLData" src= "Test.xml" ></xml>
<table id= "Tblbooks" datasrc= "#XMLData" border=1 datapagesize=2 width= "100%" >
<thead>
<th style= "Font-style:blod" > Name </th>
<th style= "Font-style:blod" > Age </th>
</thead>
<tr>
<td><span datafld= "Name" ></span></td>
<td><span datafld= "Age" ></span></td>
</tr>
</table>