Commit 6c58e52c340da0e019c943e390567957f33a59e1

Authored by Colomban Wendling
1 parent c9e74ebf
Exists in python

Add a few comments to slightly improve clarity

Showing 1 changed file with 7 additions and 0 deletions   Show diff stats
strip-frames.xsl
... ... @@ -17,9 +17,11 @@
17 17 standalone="yes"
18 18 />
19 19  
  20 +<!-- styles -->
20 21 <xsl:template match="office:automatic-styles">
21 22 <xsl:copy>
22 23 <xsl:apply-templates select="@* | node()"/>
  24 + <!-- TODO: add styles for new sections based on the frames? -->
23 25 <!-- create a derived style for each paragraph we strip from around a frame,
24 26 which should be identical but for having a 0 line height -->
25 27 <xsl:for-each select="//text:p[draw:frame]">
... ... @@ -51,6 +53,9 @@
51 53 <xsl:comment>Stripped empty &lt;text:p text:style-name="<xsl:value-of select="@text:style-name"/>"&gt;</xsl:comment>
52 54 </xsl:template>
53 55  
  56 +<!-- moves children of a draw:p containing a draw:frame outside of itself,
  57 + because we want to replace the frame with sections, which do not belong
  58 + inside a text:p -->
54 59 <xsl:template match="text:p[draw:frame]">
55 60 <xsl:comment>Removed outer text:p</xsl:comment>
56 61 <xsl:copy>
... ... @@ -88,6 +93,7 @@
88 93 </xsl:element>
89 94 </xsl:template>
90 95  
  96 +<!-- Replaces draw:frame/draw:text-box with a section -->
91 97 <xsl:template match="text:p/draw:frame[count(draw:text-box) = count(*)]">
92 98 <xsl:comment>draw:frame</xsl:comment>
93 99 <xsl:comment>draw:text-box</xsl:comment>
... ... @@ -107,6 +113,7 @@
107 113 <xsl:call-template name="copy-and-recurse"/>
108 114 </xsl:template>
109 115  
  116 +<!-- base template to match anything and call other templates -->
110 117 <xsl:template match="@* | node()" name="copy-and-recurse">
111 118 <xsl:copy>
112 119 <xsl:apply-templates select="@* | node()"/>
... ...