<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/xhtml1/strict">
<xsl:output method="html" indent="no" encoding="gb2312" />
<xsl:template match="*|/"><xsl:apply-templates /></xsl:template>
<xsl:template match="text()|@*"><xsl:value-of disable-output-escaping="yes" select="." /></xsl:template><xsl:template match="/">
<xsl:for-each select="booklist/book">
Title:<xsl:value-of select="Title" disable-output-escaping="yes" />
PublicationDate:<xsl:value-of select="PublicationDate" disable-output-escaping="yes" />
Authors:
<for-each select="Authors">
<xsl:value-of select="AuthorName" disable-output-escaping="yes" />
</for-each>
</xsl:for-each></xsl:template></xsl:stylesheet>

解决方案 »

  1.   

    <?xml version="1.0" encoding="UTF-8" ?>
    <stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <html>
    <body>
    <table>
    <xsl:apply-templtes select="BookList/Book/*" />
    </table>
    </body>
    </html>
    </xsl:template>
    <xsl:template match="*">
    <tr>
    <td>
    <xsl:value-of select="local-name()" />
    </td>
    <td>
    <xsl:value-of select="." />
    </td>
    </tr>
    </xsl:template>
    <xsl:template match="Authors">
    <tr>
    <td colspan="2">
    <xsl:value-of select="local-name()" />
    </td>
    </tr>
    <tr>
    <xsl:for-each select="AuthorName">
    <tr>
    <td colspan="2">
    <xsl:value-of select="." />
    </td>
    </tr>
    </xsl:for-each>
    </tr>
    </xsl:template>
    </stylesheet>
      

  2.   

    to:feixiang1234(飞翔)
    用你的套用後不顯示,什麼也沒有to:applexml(www.applexml.com)
    你的xsl第三行有問題幫忙呀,急用
      

  3.   

    这样就可以了,呵呵!
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/xhtml1/strict">
    <xsl:output method="html" indent="no" encoding="gb2312" />
    <xsl:template match="*|/"><xsl:apply-templates /></xsl:template>
    <xsl:template match="text()|@*"><xsl:value-of disable-output-escaping="yes" select="." /></xsl:template><xsl:template match="/">
    <html>
    <body>
    <table>
    <tr>
    <td>
    <xsl:for-each select="booklist/book">
    Title:<xsl:value-of select="Title" disable-output-escaping="yes" /><br/>
    PublicationDate:<xsl:value-of select="PublicationDate" disable-output-escaping="yes" /><br/>
    Authors:<br/>
    <for-each select="Authors">
    <xsl:value-of select="AuthorName" disable-output-escaping="yes" /><br/>
    </for-each>
    </xsl:for-each>
    </td>
    </tr>
    </table>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>
      

  4.   

    楼主,还是不行吗?
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/xhtml1/strict">
    <xsl:output method="html" indent="no" encoding="gb2312" />
    <xsl:template match="*|/"><xsl:apply-templates /></xsl:template>
    <xsl:template match="text()|@*"><xsl:value-of disable-output-escaping="yes" select="." /></xsl:template><xsl:template match="/">
    <html>
    <head>
    <title>我的xsl</title>
    </head>
    <body>
    <table>
    <tr>
    <td>
    <xsl:for-each select="booklist/book">
    Title:<xsl:value-of select="Title" disable-output-escaping="yes" /><br/>
    PublicationDate:<xsl:value-of select="PublicationDate" disable-output-escaping="yes" /><br/>
    Authors:<br/>
    <for-each select="Authors">
    <xsl:value-of select="AuthorName" disable-output-escaping="yes" /><br/>
    </for-each>
    </xsl:for-each>
    </td>
    </tr>
    </table>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>