1,4 → 1,7 |
<!-- back-direction - status: ready for regioneditor --> |
<!-- back-direction for RegionEditor |
status: not tested |
updated to given schema from 15/07/2003 |
Last Revision: 17/07/2003 by Sascha Walkenhorst --> |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
<xsl:output method="xml" indent="yes" /> |
|
8,13 → 11,15 |
</xsl:template> |
|
|
<xsl:template match="REGIONENSATZ"> |
<xsl:element name="REGIONENSATZ"> |
<xsl:template match="REGIONS"><!-- element-plugin association --> |
<xsl:element name="REGIONS"> |
|
<!-- work on attributes --> |
<xsl:attribute name="Bild"> |
<!-- get information of used image out of attribute 'image' --> |
<xsl:attribute name="image"> |
<xsl:value-of select="@image" /> |
</xsl:attribute> |
<!-- copy all other attributes --> |
<xsl:for-each select="attribute::*"> |
<xsl:if test = "not(name(.) = ('image'))"> |
<xsl:attribute name="{name(.)}"> |
24,46 → 29,378 |
</xsl:for-each> |
|
<!-- work on childs --> |
<xsl:for-each select="RECT"> |
<xsl:element name="BEREICH"> |
<xsl:attribute name="x"> |
<xsl:value-of select="@x" /> |
</xsl:attribute> |
<xsl:attribute name="y"> |
<xsl:value-of select="@y" /> |
</xsl:attribute> |
<xsl:attribute name="Breite"> |
<xsl:value-of select="@b" /> |
</xsl:attribute> |
<xsl:attribute name="Hoehe"> |
<xsl:value-of select="@h" /> |
</xsl:attribute> |
<xsl:for-each select="attribute::*"> |
<xsl:if test = "not(name(.) = 'x')"> |
<xsl:if test = "not(name(.) = 'y')"> |
<xsl:if test = "not(name(.) = 'b')"> |
<xsl:if test = "not(name(.) = 'h')"> |
<xsl:attribute name="{name(.)}"> |
<xsl:value-of select="self::node()" /> |
<!-- get information of used rectangle out of child 'RECTANGLE' --> |
<xsl:for-each select="RECTANGLE"> |
<xsl:element name="RECTANGLE"> |
<!-- get coordinates --> |
<xsl:for-each select="COORDS"> |
<xsl:element name="COORDS"> |
<xsl:attribute name="x"> |
<xsl:value-of select="@x" /> |
</xsl:attribute> |
</xsl:if></xsl:if></xsl:if></xsl:if> |
<xsl:attribute name="y"> |
<xsl:value-of select="@y" /> |
</xsl:attribute> |
<xsl:attribute name="w"> |
<xsl:value-of select="@w" /> |
</xsl:attribute> |
<xsl:attribute name="h"> |
<xsl:value-of select="@h" /> |
</xsl:attribute> |
<xsl:for-each select="attribute::*"> |
<xsl:if test = "not(name(.) = 'x')"> |
<xsl:if test = "not(name(.) = 'y')"> |
<xsl:if test = "not(name(.) = 'w')"> |
<xsl:if test = "not(name(.) = 'h')"> |
<xsl:attribute name="{name(.)}"> |
<xsl:value-of select="self::node()" /> |
</xsl:attribute> |
</xsl:if></xsl:if></xsl:if></xsl:if> |
</xsl:for-each> |
<xsl:for-each select="node()"> |
<xsl:copy-of select="self::node()" /> |
</xsl:for-each> |
<!-- Insert an attribut which saves the original name of node, |
cause all nodes which contain data are transformed to a |
"COORDS" node. This extra information is used in back- |
transformation to restore the original name. --> |
<xsl:attribute name="XMLEditorSavedNameOfNode"> |
<xsl:value-of select="name(.)" /> |
</xsl:attribute> |
</xsl:element> |
</xsl:for-each> |
<xsl:for-each select="COORD_DATA"> |
<xsl:element name="COORDS"> |
<xsl:attribute name="x"> |
<xsl:value-of select="@x_pos" /> |
</xsl:attribute> |
<xsl:attribute name="y"> |
<xsl:value-of select="@y_pos" /> |
</xsl:attribute> |
<xsl:attribute name="w"> |
<xsl:value-of select="@width" /> |
</xsl:attribute> |
<xsl:attribute name="h"> |
<xsl:value-of select="@height" /> |
</xsl:attribute> |
<xsl:for-each select="attribute::*"> |
<xsl:if test = "not(name(.) = 'x_pos')"> |
<xsl:if test = "not(name(.) = 'y_pos')"> |
<xsl:if test = "not(name(.) = 'width')"> |
<xsl:if test = "not(name(.) = 'height')"> |
<xsl:attribute name="{name(.)}"> |
<xsl:value-of select="self::node()" /> |
</xsl:attribute> |
</xsl:if></xsl:if></xsl:if></xsl:if> |
</xsl:for-each> |
<xsl:for-each select="node()"> |
<xsl:copy-of select="self::node()" /> |
</xsl:for-each> |
<!-- Insert an attribut which saves the original name of node, |
cause all nodes which contain data are transformed to a |
"COORDS" node. This extra information is used in back- |
transformation to restore the original name. --> |
<xsl:attribute name="XMLEditorSavedNameOfNode"> |
<xsl:value-of select="name(.)" /> |
</xsl:attribute> |
</xsl:element> |
</xsl:for-each> |
<!-- copy all other childs --> |
<xsl:for-each select="node()"> |
<xsl:copy-of select="self::node()" /> |
<xsl:if test = "not(name(.) = 'COORDS')"> |
<xsl:if test = "not(name(.) = 'COORD_DATA')"> |
<xsl:copy-of select="self::node()" /> |
</xsl:if></xsl:if> |
</xsl:for-each> |
</xsl:element> |
</xsl:for-each> |
|
<!-- get information of used ellipse out of child 'ELLIPSE' --> |
<xsl:for-each select="ELLIPSE"> |
<xsl:element name="ELLIPSE"> |
<!-- get coordinates --> |
<xsl:for-each select="COORDS"> |
<xsl:element name="COORDS"> |
<xsl:attribute name="x"> |
<xsl:value-of select="@x" /> |
</xsl:attribute> |
<xsl:attribute name="y"> |
<xsl:value-of select="@y" /> |
</xsl:attribute> |
<xsl:attribute name="w"> |
<xsl:value-of select="@w" /> |
</xsl:attribute> |
<xsl:attribute name="h"> |
<xsl:value-of select="@h" /> |
</xsl:attribute> |
<xsl:attribute name="angle"> |
<xsl:value-of select="@angle" /> |
</xsl:attribute> |
<xsl:for-each select="attribute::*"> |
<xsl:if test = "not(name(.) = 'x')"> |
<xsl:if test = "not(name(.) = 'y')"> |
<xsl:if test = "not(name(.) = 'w')"> |
<xsl:if test = "not(name(.) = 'h')"> |
<xsl:if test = "not(name(.) = 'angle')"> |
<xsl:attribute name="{name(.)}"> |
<xsl:value-of select="self::node()" /> |
</xsl:attribute> |
</xsl:if></xsl:if></xsl:if></xsl:if></xsl:if> |
</xsl:for-each> |
<xsl:for-each select="node()"> |
<xsl:copy-of select="self::node()" /> |
</xsl:for-each> |
</xsl:element> |
</xsl:for-each> |
<!-- copy all other childs --> |
<xsl:for-each select="node()"> |
<xsl:if test = "not(name(.) = 'COORDS')"> |
<xsl:copy-of select="self::node()" /> |
</xsl:if> |
</xsl:for-each> |
</xsl:element> |
</xsl:for-each> |
|
<!-- get information of used polyline out of child 'POLYLINE' --> |
<xsl:for-each select="POLYLINE"> |
<xsl:element name="POLYLINE"> |
<!-- get coordinates --> |
<xsl:for-each select="COORDS"> |
<xsl:element name="COORDS"> |
<xsl:attribute name="x"> |
<xsl:value-of select="@x" /> |
</xsl:attribute> |
<xsl:attribute name="y"> |
<xsl:value-of select="@y" /> |
</xsl:attribute> |
<xsl:for-each select="attribute::*"> |
<xsl:if test = "not(name(.) = 'x')"> |
<xsl:if test = "not(name(.) = 'y')"> |
<xsl:attribute name="{name(.)}"> |
<xsl:value-of select="self::node()" /> |
</xsl:attribute> |
</xsl:if></xsl:if> |
</xsl:for-each> |
<xsl:for-each select="node()"> |
<xsl:copy-of select="self::node()" /> |
</xsl:for-each> |
</xsl:element> |
</xsl:for-each> |
<!-- copy all other childs --> |
<xsl:for-each select="node()"> |
<xsl:if test = "not(name(.) = 'COORDS')"> |
<xsl:copy-of select="self::node()" /> |
</xsl:if> |
</xsl:for-each> |
</xsl:element> |
</xsl:for-each> |
|
<!-- copy all other childs --> |
<xsl:for-each select="node()"> |
<xsl:if test = "not(name(.) = 'RECT')"> |
<xsl:if test = "not(name(.) = 'RECTANGLE')"> |
<xsl:if test = "not(name(.) = 'ELLIPSE')"> |
<xsl:if test = "not(name(.) = 'POLYLINE')"> |
<xsl:copy-of select="self::node()" /> |
</xsl:if> |
</xsl:if></xsl:if></xsl:if> |
</xsl:for-each> |
|
</xsl:element> |
</xsl:template> |
|
<xsl:template match="REGIONSET"> |
<xsl:copy-of select="." /> |
<xsl:template match="REGIONSET"><!-- element-plugin association --> |
<xsl:element name="REGIONSET"> |
|
<!-- work on attributes --> |
<!-- get information of used image out of attribute 'image' --> |
<xsl:attribute name="image"> |
<xsl:value-of select="@image" /> |
</xsl:attribute> |
<!-- copy all other attributes --> |
<xsl:for-each select="attribute::*"> |
<xsl:if test = "not(name(.) = ('image'))"> |
<xsl:attribute name="{name(.)}"> |
<xsl:value-of select="self::node()" /> |
</xsl:attribute> |
</xsl:if> |
</xsl:for-each> |
|
<!-- work on childs --> |
<!-- get information of used rectangle out of child 'RECTANGLE' --> |
<xsl:for-each select="RECTANGLE"> |
<xsl:element name="RECTANGLE"> |
<!-- get coordinates --> |
<xsl:for-each select="COORDS"> |
<xsl:element name="COORDS"> |
<xsl:attribute name="x"> |
<xsl:value-of select="@x" /> |
</xsl:attribute> |
<xsl:attribute name="y"> |
<xsl:value-of select="@y" /> |
</xsl:attribute> |
<xsl:attribute name="w"> |
<xsl:value-of select="@w" /> |
</xsl:attribute> |
<xsl:attribute name="h"> |
<xsl:value-of select="@h" /> |
</xsl:attribute> |
<xsl:for-each select="attribute::*"> |
<xsl:if test = "not(name(.) = 'x')"> |
<xsl:if test = "not(name(.) = 'y')"> |
<xsl:if test = "not(name(.) = 'w')"> |
<xsl:if test = "not(name(.) = 'h')"> |
<xsl:attribute name="{name(.)}"> |
<xsl:value-of select="self::node()" /> |
</xsl:attribute> |
</xsl:if></xsl:if></xsl:if></xsl:if> |
</xsl:for-each> |
<xsl:for-each select="node()"> |
<xsl:copy-of select="self::node()" /> |
</xsl:for-each> |
<!-- Insert an attribut which saves the original name of node, |
cause all nodes which contain data are transformed to a |
"COORDS" node. This extra information is used in back- |
transformation to restore the original name. --> |
<xsl:attribute name="XMLEditorSavedNameOfNode"> |
<xsl:value-of select="name(.)" /> |
</xsl:attribute> |
</xsl:element> |
</xsl:for-each> |
<xsl:for-each select="COORD_DATA"> |
<xsl:element name="COORDS"> |
<xsl:attribute name="x"> |
<xsl:value-of select="@x_pos" /> |
</xsl:attribute> |
<xsl:attribute name="y"> |
<xsl:value-of select="@y_pos" /> |
</xsl:attribute> |
<xsl:attribute name="w"> |
<xsl:value-of select="@width" /> |
</xsl:attribute> |
<xsl:attribute name="h"> |
<xsl:value-of select="@height" /> |
</xsl:attribute> |
<xsl:for-each select="attribute::*"> |
<xsl:if test = "not(name(.) = 'x_pos')"> |
<xsl:if test = "not(name(.) = 'y_pos')"> |
<xsl:if test = "not(name(.) = 'width')"> |
<xsl:if test = "not(name(.) = 'height')"> |
<xsl:attribute name="{name(.)}"> |
<xsl:value-of select="self::node()" /> |
</xsl:attribute> |
</xsl:if></xsl:if></xsl:if></xsl:if> |
</xsl:for-each> |
<xsl:for-each select="node()"> |
<xsl:copy-of select="self::node()" /> |
</xsl:for-each> |
<!-- Insert an attribut which saves the original name of node, |
cause all nodes which contain data are transformed to a |
"COORDS" node. This extra information is used in back- |
transformation to restore the original name. --> |
<xsl:attribute name="XMLEditorSavedNameOfNode"> |
<xsl:value-of select="name(.)" /> |
</xsl:attribute> |
</xsl:element> |
</xsl:for-each> |
<!-- copy all other childs --> |
<xsl:for-each select="node()"> |
<xsl:if test = "not(name(.) = 'COORDS')"> |
<xsl:if test = "not(name(.) = 'COORD_DATA')"> |
<xsl:copy-of select="self::node()" /> |
</xsl:if></xsl:if> |
</xsl:for-each> |
</xsl:element> |
</xsl:for-each> |
|
<!-- get information of used ellipse out of child 'ELLIPSE' --> |
<xsl:for-each select="ELLIPSE"> |
<xsl:element name="ELLIPSE"> |
<!-- get coordinates --> |
<xsl:for-each select="COORDS"> |
<xsl:element name="COORDS"> |
<xsl:attribute name="x"> |
<xsl:value-of select="@x" /> |
</xsl:attribute> |
<xsl:attribute name="y"> |
<xsl:value-of select="@y" /> |
</xsl:attribute> |
<xsl:attribute name="w"> |
<xsl:value-of select="@w" /> |
</xsl:attribute> |
<xsl:attribute name="h"> |
<xsl:value-of select="@h" /> |
</xsl:attribute> |
<xsl:attribute name="angle"> |
<xsl:value-of select="@angle" /> |
</xsl:attribute> |
<xsl:for-each select="attribute::*"> |
<xsl:if test = "not(name(.) = 'x')"> |
<xsl:if test = "not(name(.) = 'y')"> |
<xsl:if test = "not(name(.) = 'w')"> |
<xsl:if test = "not(name(.) = 'h')"> |
<xsl:if test = "not(name(.) = 'angle')"> |
<xsl:attribute name="{name(.)}"> |
<xsl:value-of select="self::node()" /> |
</xsl:attribute> |
</xsl:if></xsl:if></xsl:if></xsl:if></xsl:if> |
</xsl:for-each> |
<xsl:for-each select="node()"> |
<xsl:copy-of select="self::node()" /> |
</xsl:for-each> |
</xsl:element> |
</xsl:for-each> |
<!-- copy all other childs --> |
<xsl:for-each select="node()"> |
<xsl:if test = "not(name(.) = 'COORDS')"> |
<xsl:copy-of select="self::node()" /> |
</xsl:if> |
</xsl:for-each> |
</xsl:element> |
</xsl:for-each> |
|
<!-- get information of used polyline out of child 'POLYLINE' --> |
<xsl:for-each select="POLYLINE"> |
<xsl:element name="POLYLINE"> |
<!-- get coordinates --> |
<xsl:for-each select="COORDS"> |
<xsl:element name="COORDS"> |
<xsl:attribute name="x"> |
<xsl:value-of select="@x" /> |
</xsl:attribute> |
<xsl:attribute name="y"> |
<xsl:value-of select="@y" /> |
</xsl:attribute> |
<xsl:for-each select="attribute::*"> |
<xsl:if test = "not(name(.) = 'x')"> |
<xsl:if test = "not(name(.) = 'y')"> |
<xsl:attribute name="{name(.)}"> |
<xsl:value-of select="self::node()" /> |
</xsl:attribute> |
</xsl:if></xsl:if> |
</xsl:for-each> |
<xsl:for-each select="node()"> |
<xsl:copy-of select="self::node()" /> |
</xsl:for-each> |
</xsl:element> |
</xsl:for-each> |
<!-- copy all other childs --> |
<xsl:for-each select="node()"> |
<xsl:if test = "not(name(.) = 'COORDS')"> |
<xsl:copy-of select="self::node()" /> |
</xsl:if> |
</xsl:for-each> |
</xsl:element> |
</xsl:for-each> |
|
<!-- copy all other childs --> |
<xsl:for-each select="node()"> |
<xsl:if test = "not(name(.) = 'RECTANGLE')"> |
<xsl:if test = "not(name(.) = 'ELLIPSE')"> |
<xsl:if test = "not(name(.) = 'POLYLINE')"> |
<xsl:copy-of select="self::node()" /> |
</xsl:if></xsl:if></xsl:if> |
</xsl:for-each> |
|
</xsl:element> |
</xsl:template> |
|
|