<?xml version="1.0" encoding="UTF-8" ?>

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  
  xmlns:date="http://exslt.org/dates-and-times"
  extension-element-prefixes="date">
  
	
  
  <xsl:output method="html" version="1.0" indent="yes"/>
  
  
  <xsl:template match="/">
  	<html>
  	<head>
      <title>David's Extreme 2004 Paper parse SVG anim01 into report text NLP1</title>
    </head>
    
    <body background="steel3.jpg"> 
  	<!--<div>Its <xsl:value-of select="date:time()"/> on <xsl:value-of select="date:date()"/> and all is swell.
   		[<xsl:value-of select="date:dateTime()"/>]</div> old code for debugging purposes only-->
  		
    Programmatic analysis of the SVG program produced the following findings : <br/><br/>
    	
  		<xsl:apply-templates  select="svg"/>
  		
  			
  		
  	</body>
  	
      	
  	</html>
  </xsl:template>
  
  
  
  <xsl:template match="svg">SVGtemplate <br/><br/>
   
  	<xsl:apply-templates  />
  	
  	<xsl:variable name="numberofTexts" select="count(/svg/text)"/>	
  		<xsl:variable name="numberofRects" select="count(/svg/rect)"/>
  		<xsl:variable name="numberofGroups" select="count(/svg/g)"/>
  		<xsl:variable name="numberofDescs" select="count(/svg/desc)"/>
  		<xsl:variable name="numberofSVG" select="count(/svg/svg)"/>
  		
  ANALYSIS: There are <xsl:value-of select="$numberofTexts"/> TEXT lines.
  There are <xsl:value-of select="$numberofRects"/> RECT lines.	
  There are <xsl:value-of select="$numberofGroups"/> Group lines.
  There are <xsl:value-of select="$numberofDescs"/> Desc lines.
  There are <xsl:value-of select="$numberofSVG"/> SVG lines.<br/><br/>
  
  </xsl:template>
    
  <xsl:template match="/svg/svg">SVGembedded <br/><br/> 
   
  	<xsl:apply-templates  />
  
  		
  </xsl:template>
  
  <xsl:template match="text">There is TEXT

    <xsl:value-of select="."/>
  id="<xsl:value-of select="@id"/>"
  x="<xsl:value-of select="@x"/>"
  y="<xsl:value-of select="@y"/>" 
  <xsl:apply-templates select="animate"/>
  <xsl:apply-templates select="animateColor"/>
  <br/><br/>
    
  </xsl:template>
   
  <xsl:template match="rect">There is a RECTangle 
  id="<xsl:value-of select="@id"/>"
  x="<xsl:value-of select="@x"/>"
  y="<xsl:value-of select="@y"/>"
  width="<xsl:value-of select="@width"/>"
  height="<xsl:value-of select="@height"/>"
  <xsl:apply-templates select="animate"/>
  <xsl:apply-templates select="animateColor"/>
  <br/><br/>
  </xsl:template>
  
 <xsl:template match="desc">There is a DESCription  
  <xsl:value-of select="."/>
  <br/><br/>   
  </xsl:template>
  
  <xsl:template match="g">There is a Group 
   id="<xsl:value-of select="@id"/>"
  <!--<xsl:value-of select="."/> -->
   
    <xsl:apply-templates select="path"/><br/><br/>
  </xsl:template>
  
  <xsl:template match="path">which has a PATH 
   d="<xsl:value-of select="@d"/>"
  <!--<xsl:value-of select="."/> -->
  </xsl:template>
  
  <xsl:template match="animate">, it is ANIMATEd   
  attributeName="<xsl:value-of select="@attributeName"/>"
  attributeType="<xsl:value-of select="@attributeType"/>"
  begin="<xsl:value-of select="@begin"/>"
  dur="<xsl:value-of select="@dur"/>"
  fill="<xsl:value-of select="@fill"/>"
  from="<xsl:value-of select="@from"/>"
  to="<xsl:value-of select="@to"/>"
  <br/><br/> 
  </xsl:template>
  
  <xsl:template match="animateColor">has ANIMATECOLOUR 
  attributeName="<xsl:value-of select="@attributeName"/>"
  attributeType="<xsl:value-of select="@attributeType"/>"
  begin="<xsl:value-of select="@begin"/>"
  dur="<xsl:value-of select="@dur"/>"
  fill="<xsl:value-of select="@fill"/>"
  from="<xsl:value-of select="@from"/>"
  to="<xsl:value-of select="@to"/>"
  <br/><br/> 
  </xsl:template>
  
     
</xsl:stylesheet>
   
