开发者

how to transform xsl to html?

I have an xml package which is used in ASPDOTNETSTOREFRONT.

It creates the layout for the left menu etc.

but how do i transform the XSLT to s开发者_JS百科ee what HTML it creates.

I am going crazy without an output..


Your question is a bit unclear, but you can use XSLT to transform XML to HTML like this:

<?xml version="1.0" encoding="utf-8"?>  
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">  
    <xsl:output method="html" indent="yes"/>       
    <xsl:template match="/">  
      <html>  
        <body>  
          <h2>My CD Collection</h2>  
          <table border="1">  
            <tr bgcolor="#9acd32">  
              <th>Title</th>  
              <th>Artist</th>  
            </tr>  
            <xsl:for-each select="catalog/cd">  
              <tr>  
                <td>  
                  <xsl:value-of select="title"/>  
                </td>  
                <td>  
                  <xsl:value-of select="artist"/>  
                </td>  
              </tr>  
            </xsl:for-each>  
          </table>  
        </body>  
      </html> 
    </xsl:template>   
</xsl:stylesheet>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜