Mega Code Archive

 
Categories / XML / XSLT StyleSheet
 

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>