I've followed your tips about extending the RemovalHandler.xslt;
I ended up with this, which is more similar to pseudo code... ;(
- Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
xmlns:aml="http://schemas.microsoft.com/aml/2001/core"
xmlns:java="http://xml.apache.org/xalan/java"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlPackage"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
xmlns:WX="http://schemas.microsoft.com/office/word/2003/auxHint"
xmlns:w10="urn:schemas-microsoft-com:office:word"
xmlns:xalan="http://xml.apache.org/xalan"
exclude-result-prefixes="a aml java o pic pkg r v w wp WX w10">
<xsl:template match="w:sdt">
<!-- Strips Standard content controls only. -->
<xsl:choose>
<xsl:when
test="count(w:sdtPr/w:dataBinding)=1">
<xsl:apply-templates select="w:sdtContent/node()" />
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
My questions are:
-Starting from the fact that I want to remove <databinding> and related tags, I applied the w:sdtContent/node()" template (which I don't know actually how is built, because I couldn't be able to find it, but I guess, it replaces the all <w:sdt>, with just <w:sdtContent> and his childs). The same holds for the <otherwise> module applied (which, I guess, just leaves everything as it finds it). Am I wrong? Am I missing anything?
-Once I'll have the .xslt done, how do I refer to this in my code ?
I know I'm asking you to be guided step by step, but I'm really in troubles.
Thank you