Home >Backend Development >XML/RSS Tutorial >Regarding the problem of how html embedded xml data island passes through the tree structure relationship

Regarding the problem of how html embedded xml data island passes through the tree structure relationship

高洛峰
高洛峰Original
2017-01-11 16:50:211753browse

The file of

<?xml version="1.0" encoding="UTF-8"?> 
<resume> 
<name>mike</name> 
<age>29</age> 
</resume>

html looks like this:
HTML code:

<html> 
<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> 
</html>

To avoid the above problem, there are two points that need to be modified:
1. datasrc=”# Here I missed the # number
2. You must use span.
The following are the correct code details after modification:
XML code:

<?xml version="1.0" encoding="UTF-8"?> 
<resume> 
<name>mike</name> 
<age>29</age> 
</resume>

HTML code:

<xml id="XMLData" src="test.xml"></xml> 
<table id="tblbooks" datasrc="#XMLData" border=1 datapagesize=2 width="100%"> 
<thead> 
<th style="font-style: blod">姓名</th> 
<th style="font-style: blod">年纪</th> 
</thead> 
<tr> 
<td><span datafld="name"></span></td> 
<td><span datafld="age"></span></td> 
</tr> 
</table>

For more related articles about how html embeds xml data islands through the tree structure relationship, please pay attention to the PHP Chinese website

!
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn