svghmi/gen_index_xhtml.xslt
branchsvghmi
changeset 2763 ce04d79b8e57
parent 2756 f94bc35a023e
child 2779 75c6a31caca6
equal deleted inserted replaced
2762:282500e03dbc 2763:ce04d79b8e57
     1 <?xml version="1.0"?>
     1 <?xml version="1.0"?>
     2 <xsl:stylesheet xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns:exsl="http://exslt.org/common" xmlns:ns="beremiz" xmlns:cc="http://creativecommons.org/ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/dc/elements/1.1/" extension-element-prefixes="ns" version="1.0" exclude-result-prefixes="ns">
     2 <xsl:stylesheet xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns:exsl="http://exslt.org/common" xmlns:ns="beremiz" xmlns:cc="http://creativecommons.org/ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/dc/elements/1.1/" extension-element-prefixes="ns" version="1.0" exclude-result-prefixes="ns">
     3   <xsl:output method="xml"/>
     3   <xsl:output method="xml"/>
     4   <xsl:variable name="geometry" select="ns:GetSVGGeometry()"/>
     4   <xsl:variable name="geometry" select="ns:GetSVGGeometry()"/>
       
     5   <xsl:variable name="hmitree" select="ns:GetHMITree()"/>
     5   <xsl:template match="@* | node()">
     6   <xsl:template match="@* | node()">
     6     <xsl:copy>
     7     <xsl:copy>
     7       <xsl:apply-templates select="@* | node()"/>
     8       <xsl:apply-templates select="@* | node()"/>
     8     </xsl:copy>
     9     </xsl:copy>
     9   </xsl:template>
    10   </xsl:template>
    10   <xsl:template match="/">
    11   <xsl:template match="/">
    11     <xsl:copy>
    12     <xsl:copy>
    12       <xsl:apply-templates mode="testgeo" select="$geometry"/>
    13       <xsl:comment>
       
    14         <xsl:apply-templates mode="testgeo" select="$geometry"/>
       
    15       </xsl:comment>
       
    16       <xsl:comment>
       
    17         <xsl:text>blah
       
    18 </xsl:text>
       
    19         <xsl:apply-templates mode="testtree" select="$hmitree"/>
       
    20       </xsl:comment>
    13       <xsl:apply-templates select="@* | node()"/>
    21       <xsl:apply-templates select="@* | node()"/>
    14     </xsl:copy>
    22     </xsl:copy>
    15   </xsl:template>
    23   </xsl:template>
    16   <xsl:template mode="testgeo" match="bbox">
    24   <xsl:template mode="testgeo" match="bbox">
    17     <xsl:comment>
    25     <xsl:text>ID: </xsl:text>
    18       <xsl:text>ID: </xsl:text>
    26     <xsl:value-of select="@Id"/>
    19       <xsl:value-of select="@Id"/>
    27     <xsl:text> x: </xsl:text>
    20       <xsl:text> x: </xsl:text>
    28     <xsl:value-of select="@x"/>
    21       <xsl:value-of select="@x"/>
    29     <xsl:text> y: </xsl:text>
    22       <xsl:text> y: </xsl:text>
    30     <xsl:value-of select="@y"/>
    23       <xsl:value-of select="@y"/>
    31     <xsl:text> w: </xsl:text>
    24       <xsl:text> w: </xsl:text>
    32     <xsl:value-of select="@w"/>
    25       <xsl:value-of select="@w"/>
    33     <xsl:text> h: </xsl:text>
    26       <xsl:text> h: </xsl:text>
    34     <xsl:value-of select="@h"/>
    27       <xsl:value-of select="@h"/>
    35     <xsl:text>
    28     </xsl:comment>
    36 </xsl:text>
       
    37   </xsl:template>
       
    38   <xsl:template mode="testtree" match="*">
       
    39     <xsl:param name="indent" select="''"/>
       
    40     <xsl:value-of select="$indent"/>
       
    41     <xsl:text> </xsl:text>
       
    42     <xsl:value-of select="local-name()"/>
       
    43     <xsl:text> </xsl:text>
       
    44     <xsl:value-of select="@name"/>
       
    45     <xsl:text> </xsl:text>
       
    46     <xsl:value-of select="@type"/>
       
    47     <xsl:text> </xsl:text>
       
    48     <xsl:value-of select="@path"/>
       
    49     <xsl:text>
       
    50 </xsl:text>
       
    51     <xsl:apply-templates mode="testtree" select="*">
       
    52       <xsl:with-param name="indent">
       
    53         <xsl:value-of select="concat($indent,'&gt;')"/>
       
    54       </xsl:with-param>
       
    55     </xsl:apply-templates>
    29   </xsl:template>
    56   </xsl:template>
    30 </xsl:stylesheet>
    57 </xsl:stylesheet>