svghmi/gen_index_xhtml.ysl2
branchsvghmi
changeset 2753 9a7e12e96399
child 2756 f94bc35a023e
equal deleted inserted replaced
2752:a8c9b7f0a54a 2753:9a7e12e96399
       
     1 include yslt_noindent.yml2
       
     2 istylesheet 
       
     3             /* From Inkscape */
       
     4             xmlns:dc="http://purl.org/dc/elements/1.1/"
       
     5             xmlns:cc="http://creativecommons.org/ns#"
       
     6             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
       
     7             xmlns:svg="http://www.w3.org/2000/svg"
       
     8             xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
       
     9             xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
       
    10 
       
    11             /* Our namespace to invoke python code */
       
    12             xmlns:ns="beremiz"
       
    13             extension-element-prefixes="ns" 
       
    14             exclude-result-prefixes="ns" {
       
    15     
       
    16     /* This retrieves geometry obtained through "inkscape -S" 
       
    17      * already parsed by python and presented as a list of 
       
    18      * <bbox x="0" y="0" w="42" h="42">
       
    19      */
       
    20     variable "geometry", "ns:GetSVGGeometry()";
       
    21    
       
    22     /* Identity template :
       
    23      *  - copy every attributes 
       
    24      *  - copy every sub-elements
       
    25      */
       
    26     template "@* | node()" {
       
    27       /* use real xsl:copy instead copy-of alias from yslt.yml2 */
       
    28       xsl:copy apply "@* | node()";
       
    29     }
       
    30 
       
    31     /* copy root node and add geometry as comment for a test */
       
    32     template "/" {
       
    33       xsl:copy {
       
    34           apply "$geometry", mode="testgeo";
       
    35           apply "@* | node()";
       
    36       }
       
    37     }
       
    38 
       
    39     template "bbox", mode="testgeo"{
       
    40           comment {
       
    41               > ID: «@id» x: «@x» y: «@y» w: «@w» h: «@h»
       
    42           }
       
    43     }
       
    44 }