Showing posts with label oXygen. Show all posts
Showing posts with label oXygen. Show all posts

Friday, 18 December 2009

Visio and SVG still don't work together

Unfortunately, Microsoft don't seem interested in fixing the bug in Visio's SVG export filter that leaves arrowheads off lines. The bug survived the SP2 and SP3 updates for Visio, and apparently is even present in Visio 2007!
There are several workarounds:
  • Don't use arrowheads in diagrams!
  • Fix the SVG file before using it
  • Use a different tool altogether.

To draw arrows in Visio, just draw one long and two short lines (or a line and a filled triangle), then group them together. Not pretty, but it works.

I found a small XSLT script that fixes the problem. Because SVG files are XML, you can run the script against the SVG, then save the resulting XML as a new SVG file. Here's the script:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet>
<!-- Workaround for:
http://issues.apache.org/bugzilla/show_bug.cgi?id=38831 -->
<!-- Adds overflow="visible" to all <marker> elements. -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg" exclude-result-prefixes="svg">
<xsl:output method="xml" indent="no"/>
<xsl:template match="svg:marker">
<xsl:element name="marker" xmlns="http://www.w3.org/2000/svg">
<xsl:copy-of select="@*"/>
<xsl:attribute name="overflow">visible</xsl:attribute>
<xsl:copy-of select="node()"/>
</xsl:element>
</xsl:template>
<xsl:template match="@*¦node()">
<xsl:copy>
<xsl:apply-templates select="@*¦node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>

I use oXygen to perform the transformation using the XSLT Debugger.

As far as alternative tools are concerned, I'm testing an Open Source tool called Inkscape. First impressions are that its interface is a bit quirky, but it seems perfectly adequate.

Sunday, 13 December 2009

oXygen stalls creating PDF file

This one has got me a couple of times recently, so it's probably more for my benefit than anyone else's.

When generating PDFs using oXygen, the PDFs are created correctly when using oXygen's internal DITA-OT. However, when I switch to using my own DITA-OT, the transform stalls when creating the .PDF from the .FO. As usual, oXygen's tech support came to the rescue...

Seems that "with Windows XP, Apache FOP blocks the console before the PDF is generated", whatever that means.

oXygen have introduced a patch into their internal DITA-OT to get around this. So you need to copy this patch across to your external DITA-OT version to benefit from the patch:
  1. In the build.xml file, search for the "transform.fo2pdf.fop" target.
  2. Comment out the target template and replace it with the following one:


<target name="transform.fo2pdf.fop" if="use.fop.pdf.formatter">
<java classname="org.apache.fop.cli.Main" fork="yes" classpath="${java.class.path}" dir="${dita.map.output.dir}" failonerror="true">
<arg line="-fo "${inputfile}" -pdf "${outputFile}" -c "${fop.home}/conf/fop.xconf"/>
<java>
<target>

Migrating to oXygen 11

DITA-OT transformation scenarios created for version 10.3 do not work with oXygen 11. The 10.3 scenarios contain references to Saxon libraries that no longer exist in oXygen 11 because they have migrated to the enterprise edition of Saxon.
There are two easy workarounds:
1) Create new transformation scenarios and manually recreate the settings.
2) Edit the old transformation scenarios. Go to the Advanced tab and click the Libraries button.
In the Custom Libraries list, remove saxon9sa.jar and saxon9-dom.jar, then add ${oxygenHome}/lib/saxon9ee.jar