diff options
author | Henning Brinkmann[hbrinkm] <hbrinkm@openoffice.org> | 2009-12-17 16:15:14 +0100 |
---|---|---|
committer | Henning Brinkmann[hbrinkm] <hbrinkm@openoffice.org> | 2009-12-17 16:15:14 +0100 |
commit | 20e40d5b2eb528d4847165dc65cd660407a7c47e (patch) | |
tree | 3f13aa5cc2bb5d0b08eebf599b6c819a8a029c5a | |
parent | 799d2e707a549048a417db618180e327c46cc9f2 (diff) |
writerfilter07: modelcleanup.xsl: generate Value-resource instead of StringValue-resource
-rw-r--r-- | writerfilter/source/ooxml/modelcleanup.xsl | 51 |
1 files changed, 48 insertions, 3 deletions
diff --git a/writerfilter/source/ooxml/modelcleanup.xsl b/writerfilter/source/ooxml/modelcleanup.xsl index 2f3754e5e1a4..cabd52a30cab 100644 --- a/writerfilter/source/ooxml/modelcleanup.xsl +++ b/writerfilter/source/ooxml/modelcleanup.xsl @@ -89,6 +89,53 @@ </xsl:element> </xsl:template> + <xsl:template name="generatevalueresource"> + <xsl:variable name="name" select="@name"/> + <resource> + <xsl:attribute name="name"> + <xsl:value-of select="@name"/> + </xsl:attribute> + <xsl:attribute name="resource">Value</xsl:attribute> + <xsl:attribute name="generated">yes</xsl:attribute> + <xsl:for-each select=".//rng:attribute"> + <xsl:variable name="type"> + <xsl:choose> + <xsl:when test="rng:ref[@name='ST_OnOff']"> + <xsl:text>Boolean</xsl:text> + </xsl:when> + <xsl:when test="rng:text"> + <xsl:text>String</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="typeofattribute"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <attribute> + <xsl:attribute name="name"> + <xsl:value-of select="@name"/> + </xsl:attribute> + <xsl:attribute name="tokenid"> + <xsl:text>ooxml:</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>_</xsl:text> + <xsl:value-of select="@name"/> + </xsl:attribute> + <xsl:attribute name="action"> + <xsl:text>setValue</xsl:text> + </xsl:attribute> + </attribute> + <action name="start"> + <xsl:attribute name="action"> + <xsl:text>setDefault</xsl:text> + <xsl:value-of select="$type"/> + <xsl:text>Value</xsl:text> + </xsl:attribute> + </action> + </xsl:for-each> + </resource> + </xsl:template> + <xsl:template match="namespace"> <xsl:variable name="nsid" select="generate-id(.)"/> <xsl:element name="namespace"> @@ -102,9 +149,7 @@ <xsl:if test="count($resources) = 0"> <xsl:if test="substring(@name, 1, 3) = 'CT_'"> <xsl:if test="./rng:attribute[@name='val']/rng:text"> - <xsl:call-template name="generateresource"> - <xsl:with-param name="resource">StringValue</xsl:with-param> - </xsl:call-template> + <xsl:call-template name="generatevalueresource"/> </xsl:if> </xsl:if> <xsl:if test="substring(@name, 1, 3) = 'ST_'"> |