Commit 6c764eda authored by Wendell Piez's avatar Wendell Piez
Browse files

#110, #152 including preliminary image handling

parent 6d3f878c
......@@ -4,6 +4,8 @@
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
xmlns="http://www.w3.org/1999/xhtml" xmlns:xsw="http://coko.foundation/xsweet"
......@@ -189,6 +191,15 @@
<xsl:apply-templates mode="render-css" select="w:pPr"/>
</xsl:variable>
<!-- Echoing XSweet properties as semantic data-* attributes -->
<xsl:variable name="semantic-properties"
select="tokenize($style, '\s*;\s*')[matches(., 'xsweet-(outline|list)-level')]"/>
<xsl:for-each select="$semantic-properties">
<xsl:attribute name="data-{ replace(., ':.*$', '')}">
<xsl:value-of select=". ! replace(., '.*:\s*', '')"/>
</xsl:attribute>
</xsl:for-each>
<!-- Adding the attribute only when there is a value. -->
<xsl:if test="matches($style, '\S')">
<xsl:attribute name="style" select="$style"/>
......@@ -198,6 +209,7 @@
<xsl:apply-templates select="w:pPr" mode="build-properties"/>
</xsl:if>
<xsl:apply-templates select="*"/>
</p>
</xsl:template>
......@@ -738,6 +750,18 @@
</xsl:template>
<!--<v:imagedata r:id="rId6" o:title="Highschool-singing"/>-->
<xsl:template match="v:imagedata">
<img>
<!-- If we can, we will grab the target of an external link -->
<xsl:for-each select="key('rels-by-id',@r:id,$relations-doc)">
<xsl:attribute name="src" select="@Target"/>
</xsl:for-each>
</img>
</xsl:template>
<xsl:include href="docx-table-extract.xsl"/>
</xsl:stylesheet>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment