Hello, I first want to say thank you for creating the image addition to the word2html xslt, for the most part it works fantastic. Is there any way to convert images created though words drawing toobar though? I have many shapes that don't get converted over. Any help would be appreciated
Thanks
David
I have done some research about this now, and looks like this should be easy. All of the drawings are in vml. I removed the v from the exlude list at the top and that gets me the vml namespace. I just need to figure out a way to make it so the v: items are being put back into my html document. I did a manual test and it works perfect. I guess i just need to figure out how to copy v:rect ect to the transformed document.
here is your w:pict template
<xsl:template match="w:pict"> <xsl:choose> <xsl:when test="w:binData"> <xsl:variable name="dir"> <!-- We need something unique instead of document name --> <!-- Let's take first 10 characters of title --> <xsl:value-of select="translate(substring($ndOfficeDocPr/o:Title, 1, 10), ' ', '_')"/> <xsl:text>_files</xsl:text> </xsl:variable> <img src="{ext:decodePicture(w:binData, $base-dir-for-images, $base-virtual-dir-for-images, $dir, substring-after(w:binData/@w:name, 'wordml://'))}" alt="{v:shape/v:imagedata/@o:title}" style="{v:shape/@style}" title="{v:shape/v:imagedata/@o:title}"/> </xsl:when> <xsl:otherwise> <xsl:copy> <xsl:apply-templates/> </xsl:copy> </xsl:otherwise> </xsl:choose></xsl:template>
then just change line 27 to:
exclude-result-prefixes="msxsl ext w o WX aml w10">
thats it!
Thanks for the research. I'll update the stylesheet.
Btw, I found out VML's <v:imagedata> works better for Internet Explorer than <img>. So I'm going to produce conditional markup (<!--[if vml]--> sort of thing so IE will work with VML only and the rest - <img>).