关于xml与xslt
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="a.xslt"?>
<project>
<image src="logo.gif" />
<text>This is content.哈哈</text>
</project>
a.xslt:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<!--
This is an XSLT template file. Fill in this area with the
XSL elements which will transform your XML to XHTML.
-->
<h1>
<xsl:value-of select="/project/text" />
</h1>
<img border="0">
<xsl:attribute name="src">
<xsl:value-of select="/project/image/@src" />
</xsl:attribute>
</img>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
浙公网安备 33010602011771号