<?xml version="1.0" ?>
<!DOCTYPE stylesheet 
[
<!ENTITY nbsp    "&#160;">
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		version="1.0"
                xmlns:vmp="http://www.hoise.com/vmp/1.0">

<xsl:output method="text"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="vmp:editor-screen">
<xsl:apply-templates/>
</xsl:template>


<xsl:template match="vmp:stat/@wordcount |
                     vmp:attach/@name |
                     vmp:attach/@description |
                     vmp:author/@name |
                     vmp:author/@date |
                     vmp:editor/@name |
                     vmp:editor/@date |
                     vmp:editor/@comment |
                     vmp:place/@name |
                     vmp:place/@date |
                     vmp:part/@name |
                     vmp:part/@section |
                     vmp:part/@subsection |
                     vmp:part/@issue |
                     vmp:part/@rank |
                     vmp:part/@status 
                     ">
<xsl:value-of select="concat('vmppar',substring(ancestor::vmp:editor-screen/@id,2),'.',local-name(..),'_',local-name(.),'=',.)"/>
<xsl:text>
</xsl:text>
</xsl:template>


<xsl:template match="vmp:article/@id">
<xsl:value-of select="concat('vmppar',substring(ancestor::vmp:editor-screen/@id,2),'.',local-name(..),local-name(.),'=',.)"/>
<xsl:text>
</xsl:text>
</xsl:template>


<xsl:template match="vmp:title |
                     vmp:custom_name |
                     vmp:templates-label 
                        ">

<xsl:value-of select="concat('vmppar',substring(ancestor::vmp:editor-screen/@id,2),'.',translate(local-name(.),'-',''),'=',.)"/>
</xsl:template>

<xsl:template match="vmp:lead |
                     vmp:lead-short |
                     vmp:lead-con |
                     vmp:main 
                        ">

<xsl:value-of select="concat('vmppar',substring(ancestor::vmp:editor-screen/@id,2),'.',translate(local-name(.),'-',''),'text=',.)"/>
</xsl:template>



<!-- niet elk tool gebruikt de correcte naam voor vmp:ref moet nog worden gewijzigd, intussen: -->
<xsl:template match="vmp:subtitle/@name  
                        ">

<xsl:value-of select="concat('vmppar',substring(ancestor::vmp:editor-screen/@id,2),'.',translate(local-name(..),'-',''),'=',.)"/>
</xsl:template>

<xsl:template match="vmp:ref ">
<xsl:value-of select="concat('vmppar',substring(ancestor::vmp:editor-screen/@id,2),'.',translate(local-name(.),'-',''),'text=',.)"/>
<xsl:text>
</xsl:text>
<xsl:value-of select="concat('vmppar',substring(ancestor::vmp:editor-screen/@id,2),'.',translate(local-name(.),'-',''),'erencestext=',.)"/>
</xsl:template>



<xsl:template match="vmp:magazine">
<xsl:text>

</xsl:text>
vmppar.mag_<xsl:number/>= <xsl:value-of select="@name"/>
<xsl:text>

</xsl:text>

vmppar.mag_<xsl:number/>y=<xsl:value-of select="vmp:issue/@year"/>
<xsl:text>
</xsl:text>
vmppar.mag_<xsl:number/>m=<xsl:value-of select="vmp:issue/@month"/>
<xsl:text>
</xsl:text>
vmppar.mag_<xsl:number/>d=<xsl:value-of select="vmp:issue/@day"/>
<xsl:text>
</xsl:text>


<xsl:call-template name="vmp:section">
<xsl:with-param name="counters">1</xsl:with-param>
<xsl:with-param name="mag">vmppar.mag_<xsl:number/></xsl:with-param></xsl:call-template>
</xsl:template>


<xsl:template name="vmp:section">
<xsl:param name="counters"/>
<xsl:param name="mag"></xsl:param>


<xsl:if test="$counters &lt; 7 ">
<xsl:text>

</xsl:text>
<xsl:choose>
<xsl:when test="vmp:section[$counters]/@name">
<xsl:value-of select="concat($mag,'section_',$counters)"/>=<xsl:value-of select="vmp:section[$counters]/@name"/></xsl:when>
<xsl:otherwise><xsl:value-of select="concat($mag,'section_',$counters)"/>= null</xsl:otherwise>
</xsl:choose>

<xsl:text>
</xsl:text>
<xsl:call-template name="vmp:subsection">
<xsl:with-param name="magsection"><xsl:value-of select="concat($mag,'section_',$counters)"/></xsl:with-param>
<xsl:with-param name="counter">1</xsl:with-param>
<xsl:with-param name="counters" select="$counters"/>
</xsl:call-template>

<xsl:call-template name="vmp:section">
<xsl:with-param name="mag" select="$mag"/>
<xsl:with-param name="counters" select="$counters+1"/>
</xsl:call-template>
</xsl:if>
</xsl:template> 


<xsl:template name="vmp:subsection">
<xsl:param name="counter"/>
<xsl:param name="counters"/>
<xsl:param name="magsection"/>
<xsl:variable name="sectionname"><xsl:value-of select="vmp:section[$counters]/@name" /> </xsl:variable>


<xsl:if test="$counter &lt; 15 ">
<xsl:choose>
<xsl:when test="vmp:section[@name = $sectionname]/vmp:subsection[$counter]/@name" >
<xsl:value-of select="concat($magsection,'subsection_',$counter)"/>=<xsl:value-of select="vmp:section[@name = $sectionname]/vmp:subsection[$counter]/@name"/>
<xsl:text>
</xsl:text></xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($magsection,'subsection_',$counter)"/>= null
</xsl:otherwise>
</xsl:choose>

<xsl:call-template name="vmp:subsection">
<xsl:with-param name="magsection" select="$magsection"/>
<xsl:with-param name="counters" select="$counters"/>
<xsl:with-param name="counter" select="$counter+1"/>
</xsl:call-template>
</xsl:if>
</xsl:template> 

                    
                     
<xsl:template match="*|@*">
  <xsl:copy>
    <xsl:apply-templates select="@*"/>
    <xsl:apply-templates select="node()"/>
  </xsl:copy>

</xsl:template>
  
   


</xsl:stylesheet>

