Embedded style sheet into xml document : stylesheet « XSLT stylesheet « XML






Embedded style sheet into xml document


<?xml version="1.0" standalone="no" ?>
<?xml-stylesheet type="text/xsl" href="#id(transcriptstyle)"?>

<transcript>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    id="transcriptstyle">

    <xsl:template match="/">
      <html>
        <xsl:apply-templates />
      </html>
    </xsl:template>

    <xsl:template match="report">
      <xsl:apply-templates />
    </xsl:template>

    <xsl:template match="order">
      <P>
        <xsl:value-of select="." />
      </P>
    </xsl:template>
  </xsl:stylesheet>

  <student id="STU12345" name="name 1" status="active">
    <home_address>35 Wall Street, Wonderland, NJ</home_address>
    <interests>
      <interest>interest 1</interest>
      <interest>interest 2</interest>
      <interest>interest 3</interest>
    </interests>
  </student>
  <term>
    <heading name="Winter 1999" />
    <course>
      <course-name>course 1</course-name>
      <grade>A-</grade>
      <credits>4</credits>
    </course>
    <course>
      <course-name>course 2</course-name>
      <grade>B+</grade>
      <credits>3</credits>
    </course>
  </term>
  <summary>summary</summary>
  <comments>
     
    comments
  </comments>
</transcript>

 








Related examples in the same category

1.Empty transform
2.Transform another style sheet
3.Generate Java code
4.Generate SVG document
5.Generate html tags