Ignore:
Timestamp:
04/13/08 00:22:49 (4 years ago)
Author:
jharrop
Message:

Filter can removeProofErrors, removeRsids, removeContentControls

Location:
trunk/docx4j/src/main/java/org/docx4j/openpackaging/packages
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/docx4j/src/main/java/org/docx4j/openpackaging/packages/WordprocessingMLPackage.java

    r322 r323  
    182182        // The JAXB object org.docx4j.wml.Package is 
    183183        // custom built for this purpose. 
     184         
     185        // TODO - this method currently only puts the main document 
     186        // part and the styles part into the pkg.   
     187        // Extend it so that it can optionally do the others as well. 
     188        // Likewise, the converse. 
    184189         
    185190        // Create a org.docx4j.wml.Package object 
  • trunk/docx4j/src/main/java/org/docx4j/openpackaging/packages/filter.xslt

    r321 r323  
    1919<!-- One line for each of the things in FilterSettings -->               
    2020<xsl:param name="removeProofErrors"/> <!-- select="'passed in'"-->       
     21<xsl:param name="removeContentControls"/> 
     22<xsl:param name="removeRsids"/>  
    2123         
     24                 
    2225<xsl:template match="@*|node()"> 
    2326  <xsl:copy> 
     
    2629</xsl:template> 
    2730 
     31<xsl:template match="w:proofErr"> 
     32         
     33        <xsl:choose> 
     34                <xsl:when test="$removeProofErrors=true()"> 
     35                        <!-- ignore it --> 
     36                </xsl:when> 
     37                <xsl:otherwise> 
     38                  <xsl:copy> 
     39                        <xsl:apply-templates select="@*|node()"/> 
     40                  </xsl:copy> 
     41                </xsl:otherwise> 
     42        </xsl:choose> 
     43         
     44</xsl:template>  
     45 
     46<xsl:template match="w:sdt"> 
     47         
     48        <xsl:choose> 
     49                <xsl:when test="$removeContentControls=true()"> 
     50                        <xsl:apply-templates select="w:sdtContent/*"/> 
     51                </xsl:when> 
     52                <xsl:otherwise> 
     53                  <xsl:copy> 
     54                        <xsl:apply-templates select="@*|node()"/> 
     55                  </xsl:copy> 
     56                </xsl:otherwise> 
     57        </xsl:choose> 
     58         
     59</xsl:template>  
     60         
     61 
     62<xsl:template match="@w:rsidRPr | @w:rsidDel | @w:rsidR | @w:rsidSect | @w:rsidTr | @w:rsidP | @w:rsidRDefault | w:rsids | w:rsidRoot | w:rsid  "> 
     63        <!-- rsids contains rsidRoot and rsid --> 
     64         
     65        <xsl:choose> 
     66                <xsl:when test="$removeRsids=true()"> 
     67                        <!-- ignore it --> 
     68                </xsl:when> 
     69                <xsl:otherwise> 
     70                  <xsl:copy> 
     71                        <xsl:apply-templates select="@*|node()"/> 
     72                  </xsl:copy> 
     73                </xsl:otherwise> 
     74        </xsl:choose> 
     75         
     76</xsl:template>  
     77         
     78                 
     79         
     80                 
     81<!--     
    2882<xsl:template match="pkg:part[pkg:xmlData/w:document]"> 
    2983   <pkg:part> 
     
    57111    </pkg:part>   
    58112</xsl:template> 
    59  
    60         <!-- 
    61                                 <xsl:variable name="targetFont"  
    62                                 select="java:org.docx4j.fonts.Substituter.getSubstituteFontXsltExtension($substituterInstance,  
    63                                                         string($documentFont), 'BoldItalic', boolean($fontFamilyStack))" /> 
    64                         font-family:'<xsl:value-of select="$targetFont"/>';                                              
    65113--> 
    66114 
Note: See TracChangeset for help on using the changeset viewer.