Transform another style sheet : stylesheet « XSLT stylesheet « XML






Transform another style sheet


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

  <xsl:template match="/">
    <xsl:element name="paragraph">
      <xsl:attribute name="priority">medium</xsl:attribute>
      <xsl:apply-templates />
    </xsl:element>
  </xsl:template>

</xsl:stylesheet>


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

  <xsl:template match="/">
    <xsl:element name="paragraph">
      <xsl:attribute name="priority">medium</xsl:attribute>
      <xsl:apply-templates />
    </xsl:element>
  </xsl:template>

</xsl:stylesheet>
Output:

<?xml version="1.0" encoding="UTF-8"?>
<paragraph priority="medium">
  

  
    
      medium
      
    
  

</paragraph>

 








Related examples in the same category

1.Empty transform
2.Embedded style sheet into xml document
3.Generate Java code
4.Generate SVG document
5.Generate html tags