开发者

how to transform xsl to html?

开发者 https://www.devze.com 2023-04-04 19:20 出处:网络
I have an xml package which is used in ASPDOTNETSTOREFRONT. It creates the layout for the left menu etc.

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

精彩评论

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

关注公众号