Output whole xhtml document : html « XSLT stylesheet « XML






Output whole xhtml document


File: Data.xml

<?xml version="1.0"?>

<message>
  You can add processing instructions to a document with the
  <courier>processing-instruction</courier>
  element.
</message>

File: Transform.xslt
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" indent="yes" />

  <xsl:template match="/">
    <html>
      <head>
        <title>HTML Output</title>
      </head>
      <body>
        <p>
          <xsl:apply-templates />
        </p>
      </body>
    </html>
  </xsl:template>

</xsl:stylesheet>

Output:

<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>HTML Output</title>
   </head>
   <body>
      <p>
           You can add processing instructions to a document with the
           processing-instruction
           element.
         
      </p>
   </body>
</html>

 








Related examples in the same category

1.Output various html tags
2.Output html img tag
3.One html tag per template
4.Wrap HTML tags in template
5.Format output with HTML tags
6.Construct image name used by generated HTML in style sheet
7.html output method to make br tags come out as
8.Output html with frameset
9.Transformation of book information into XHTML with sorting
10.Add more format with html tags
11.Format output with font
12.Use blockquote to output value from xml