<?xml version="1.0" encoding="gb2312" ?> <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:output method="html" /> <xsl:param name="queryParam" select="''" /> <xsl:template match="/data"> <table border="1"> <tbody> <tr> <td> <table width="400" border="1"> <tbody> <xsl:apply-templates select="port"> <xsl:sort select="id" order="ascending" /> </xsl:apply-templates> </tbody> </table> </td> </tr> </tbody> </table> </xsl:template> <xsl:template match="port"> <tr> <td align="left" width="50"> <xsl:value-of select="name"/> </td> <td> <xsl:value-of select="id"/> </td> </tr> </xsl:template> </xsl:stylesheet> <?xml version="1.0" encoding="GB2312"?> <?xml-stylesheet type="text/xsl" href="sss.xsl"?> <data> <port> <id>2 </id> <name>a </name> </port> <port> <id>1 </id> <name>b </name> </port> <port> <id>3 </id> <name>c </name> </port> </data>
如何实现XML+XSL排序
最新推荐文章于 2021-02-16 11:09:43 发布