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

高洛峰
Release: 2017-01-11 16:50:21
Original
1740 people have browsed it

The file of

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

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>
Copy after login

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>
Copy after login
Copy after login

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>
Copy after login

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

!
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template