如何将XML转换成HTML
原XML XMLFile.xml
XML code:
<?xml version="1.0" encoding="iso-8859-1"?>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
</catalog>
然后用XSLT解析上面的XML cdcatalog.xsl
XML code:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" />
<xsl:template match="/">
<h2>My CD Collection</h2>
<table border="0">
<tr bgcolor="#9acd32">
<th align="left">Title</th>
<th align="left">Artist</th>
</tr>
<xsl:for-each select="catalog/cd">
<tr>
<td>
<xsl:value-of select="title"/>
</td>
<td>
<xsl:val
相关问答:
DataSet导出xml 批处理(循环)得怎么处理
XML文件
<A>
<B>
<C>
</C>
&nb ......
<?xml version="1.0" encoding="UTF-8" ?>
<root>
<video>
<device deviceid="\\?\usb#vid_0c45&pid_613b#5&2d0620de& ......
<?xml version="1.0" encoding="utf-8" ?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical&q ......
XML文件内容:
- <ResList>
<page>0</page>
- <resItem>
<resName>WWW</resName>
</resItem>
- <resItem>
&nb ......
有一个XML
XML code:
<Person>
<Node>
<Name>admin</Name>
<Date>2010-4-6</Date>
</Node>
<Node>
<Name>lisi</Name>
......