Mega Code Archive

 
Categories / XML Tutorial / Xpath
 

Value-of select=

File: Data.xml <?xml version="1.0"?> <greeting>   Hello, World! </greeting> File: Transform.xslt <?xml version="1.0"?> <xsl:stylesheet version="1.0"    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">   <xsl:output method="html"/>   <xsl:template match="/">     <xsl:apply-templates select="greeting"/>   </xsl:template>      <xsl:template match="greeting">     <html>       <body>         <h1>           <xsl:value-of select="."/>         </h1>       </body>     </html>   </xsl:template> </xsl:stylesheet> Output: <html>    <body>       <h1>          Hello, World!                 </h1>    </body> </html>