svghmi/gen_index_xhtml.ysl2
branchsvghmi
changeset 2840 e588f25e6c74
parent 2839 f4dd234faa11
child 2841 7c6050cde9e3
equal deleted inserted replaced
2839:f4dd234faa11 2840:e588f25e6c74
    11 in xsl decl optional_labels(*ptr, name="defs_by_labels") alias call-template {
    11 in xsl decl optional_labels(*ptr, name="defs_by_labels") alias call-template {
    12     with "hmi_element", "$hmi_element";
    12     with "hmi_element", "$hmi_element";
    13     with "labels"{text *ptr};
    13     with "labels"{text *ptr};
    14     with "mandatory","'no'";
    14     with "mandatory","'no'";
    15 };
    15 };
       
    16 
       
    17 in xsl decl svgtmpl(match, xmlns="http://www.w3.org/2000/svg") alias template;
    16 
    18 
    17 istylesheet
    19 istylesheet
    18             /* From Inkscape */
    20             /* From Inkscape */
    19             xmlns:dc="http://purl.org/dc/elements/1.1/"
    21             xmlns:dc="http://purl.org/dc/elements/1.1/"
    20             xmlns:cc="http://creativecommons.org/ns#"
    22             xmlns:cc="http://creativecommons.org/ns#"
   114     }
   116     }
   115 
   117 
   116     /* replaces inkscape's height and width hints. forces fit */
   118     /* replaces inkscape's height and width hints. forces fit */
   117     template "svg:svg/@width", mode="inline_svg";
   119     template "svg:svg/@width", mode="inline_svg";
   118     template "svg:svg/@height", mode="inline_svg";
   120     template "svg:svg/@height", mode="inline_svg";
   119     template "svg:svg", mode="inline_svg" xsl:copy {
   121     svgtmpl "svg:svg", mode="inline_svg" svg {
   120         attrib "preserveAspectRatio" > none
   122         attrib "preserveAspectRatio" > none
   121         attrib "height" > 100vh
   123         attrib "height" > 100vh
   122         attrib "width" > 100vw
   124         attrib "width" > 100vw
   123         apply "@* | node()", mode="inline_svg";
   125         apply "@* | node()", mode="inline_svg";
   124     }
   126     }
   145         }
   147         }
   146         comment {
   148         comment {
   147             apply "$indexed_hmitree", mode="testtree";
   149             apply "$indexed_hmitree", mode="testtree";
   148         }
   150         }
   149         /**/
   151         /**/
   150         html xmlns="http://www.w3.org/1999/xhtml" {
   152         html xmlns="http://www.w3.org/1999/xhtml"
       
   153              xmlns:svg="http://www.w3.org/2000/svg"
       
   154              xmlns:xlink="http://www.w3.org/1999/xlink" {
   151             head;
   155             head;
   152             body style="margin:0;overflow:hidden;" {
   156             body style="margin:0;overflow:hidden;" {
   153                 apply "svg:svg", mode="inline_svg";
   157                 apply "svg:svg", mode="inline_svg";
   154                 script{
   158                 script{
   155                     call "scripts";
   159                     call "scripts";