svghmi/inline_svg.ysl2
changeset 3625 bb1eff4091ab
parent 3393 a65bcbb6af20
child 3690 f41733be17a8
equal deleted inserted replaced
3624:770c613c424f 3625:bb1eff4091ab
    38 }
    38 }
    39 
    39 
    40 // remove i18n markers, so that defs_by_labels can find text elements
    40 // remove i18n markers, so that defs_by_labels can find text elements
    41 svgtmpl "svg:text/@inkscape:label[starts-with(., '_')]", mode="inline_svg" {
    41 svgtmpl "svg:text/@inkscape:label[starts-with(., '_')]", mode="inline_svg" {
    42     attrib "{name()}" > «substring(., 2)»
    42     attrib "{name()}" > «substring(., 2)»
       
    43 }
       
    44 
       
    45 // remove "reference" and "frame" rectangles
       
    46 svgtmpl "svg:rect[@inkscape:label='reference' or @inkscape:label='frame']", mode="inline_svg" {
       
    47     // nothing
       
    48 }
       
    49 
       
    50 svgtmpl "svg:g[svg:rect/@inkscape:label='frame']", mode="inline_svg" {
       
    51     const "reference_rect","(../svg:rect | ../svg:g/svg:rect)[@inkscape:label='reference']";
       
    52     const "frame_rect","svg:rect[@inkscape:label='frame']";
       
    53     const "offset","func:offset($frame_rect, $reference_rect)";
       
    54 
       
    55     xsl:copy {
       
    56         attrib "svghmi_x_offset" value "$offset/vector/@x";
       
    57         attrib "svghmi_y_offset" value "$offset/vector/@y";
       
    58         apply "@* | node()", mode="inline_svg";
       
    59     }
    43 }
    60 }
    44 
    61 
    45 ////// Clone unlinking
    62 ////// Clone unlinking
    46 //
    63 //
    47 // svg:use (inkscape's clones) inside a widgets are
    64 // svg:use (inkscape's clones) inside a widgets are