Skip to content

Commit

Permalink
handle different xml rels namings for footnotes, endnotes and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fr4nze committed Aug 3, 2023
1 parent cef12a2 commit 486d6a5
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions xsl/insert-xpath.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,25 @@
<xsl:if test="doc-available(resolve-uri('numbering.xml', $base-dir))">
<xsl:apply-templates select="document(resolve-uri('numbering.xml', $base-dir))/w:numbering" mode="#current"/>
</xsl:if>
<xsl:if test="doc-available(resolve-uri('footnotes.xml', $base-dir))">
<xsl:apply-templates select="document(resolve-uri('footnotes.xml', $base-dir))/w:footnotes" mode="#current"/>
</xsl:if>
<xsl:if test="doc-available(resolve-uri('endnotes.xml', $base-dir))">
<xsl:apply-templates select="document(resolve-uri('endnotes.xml', $base-dir))/w:endnotes" mode="#current"/>
<xsl:for-each select="document($docRels-uri)/rel:Relationships
/rel:Relationship[@Type eq 'http:https://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes']/@Target">
<xsl:if test="doc-available(resolve-uri(current(), $base-dir))">
<xsl:apply-templates select="document(resolve-uri(current(), $base-dir))/w:footnotes" mode="#current"/>
</xsl:if>
</xsl:for-each>
<xsl:for-each select="document($docRels-uri)/rel:Relationships
/rel:Relationship[@Type eq 'http:https://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes']/@Target">
<xsl:if test="doc-available(resolve-uri(current(), $base-dir))">
<xsl:apply-templates select="document(resolve-uri(current(), $base-dir))/w:endnotes" mode="#current"/>
</xsl:if>
</xsl:for-each>
<xsl:apply-templates select="document(resolve-uri('settings.xml', $base-dir))/w:settings" mode="#current"/>
<xsl:if test="doc-available(resolve-uri('comments.xml', $base-dir))">
<xsl:apply-templates select="document(resolve-uri('comments.xml', $base-dir))/w:comments" mode="#current"/>
</xsl:if>
<xsl:for-each select="document($docRels-uri)/rel:Relationships
/rel:Relationship[@Type eq 'http:https://schemas.openxmlformats.org/officeDocument/2006/relationships/comments']/@Target">
<xsl:if test="doc-available(resolve-uri(current(), $base-dir))">
<xsl:apply-templates select="document(resolve-uri(current(), $base-dir))/w:comments" mode="#current"/>
</xsl:if>
</xsl:for-each>
<xsl:apply-templates select="document(resolve-uri('fontTable.xml', $base-dir))/w:fonts" mode="#current"/>
<w:docTypes>
<xsl:apply-templates select="document(resolve-uri('../%5BContent_Types%5D.xml', $base-dir))/ct:Types" mode="#current"
Expand Down

0 comments on commit 486d6a5

Please sign in to comment.