Search code examples
htmlxsltaspdotnetstorefront

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 see what HTML it creates.

I am going crazy without an output..


Solution

  • 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>