Issue with SVG DTD validation with XEP/Oxygen (Dita source -

This should cover W3C XML Schema, Relax NG and DTD related problems.
annetteb
Posts: 24
Joined: Tue Apr 15, 2014 6:43 pm

Issue with SVG DTD validation with XEP/Oxygen (Dita source -

Post by annetteb »

Hello,
I'm using XEP to create PDF files from DITA source files in Oxygen. I'm having trouble with the DTD validation (in details, if I comment the doctype declaration, there is no problem, if I leave the doctype declaration, I got the following error message
[java] EXCEPTION: Failed to create image file:/D:/SVN-Annette/IFU_MT/Sources/Projet_ong/trunk/graphics/device_identification_label_SN.svg of type null
which I think is caused by the online validation blocked by the company proxy).
As indicated in xep user documentation, I tried to set up a catalog to have XEP validate with a local DTD but to no avail.
Here is what I did:

1/ Copied svg10.dtd and svg11.dtd from Oxygen directory to C:\XML_DTD (Windows 7 OS).

2/ Downloaded xml-commons-resolver-1.2 (so resolver.jar is in C:\XML_DTD\xml-commons-resolver-1.2).

3/ Created a catalog file as follows (catalog.xml in C:\XML_DTD):

Code: Select all

<?xml version="1.0"?>
<!--<!DOCTYPE catalog
PUBLIC "-//OASIS/DTD Entity Resolution XML Catalog V1.0//EN"
"http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"> -->
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<public
publicId="-//W3C//DTD SVG 1.1//EN"
uri="file:///c:/xml_dtd/svg11.dtd"/>
<system
systemId="http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"
uri="file:///c:/xml_dtd/svg11.dtd"/>
</catalog>
4/ Created a properties file (CatalogManager.properties in C:\XML_DTD) as follows:
catalogs=C:/XML_DTD/catalog.xml

Code: Select all

relative-catalogs=yes
verbosity=4
prefer=system
static-catalog=yes
allow-oasis-xml-catalog-pi=yes
5/ Modified XEP batch script as follows:

Code: Select all

@echo off
rem This batch file encapsulates a standard XEP call.

set CP=C:\XML_DTD\xml-commons-resolver-1.2;C:\Program Files\RenderX\XEP\lib\xep.jar;C:\Program Files\RenderX\XEP\lib\saxon6.5.5\saxon.jar;C:\Program Files\RenderX\XEP\lib\saxon6.5.5\saxon-xml-apis.jar;C:\Program Files\RenderX\XEP\lib\xt.jar

if x%OS%==xWindows_NT goto WINNT
"C:\Program Files\Java\jre6\bin\java" -Dcom.renderx.sax.entityresolver=org.apache.xml.resolver.tools.CatalogResolver \
-Dcom.renderx.jaxp.uriresolver=org.apache.resolver.tools.CatalogResolver \ -classpath "%CP%" com.renderx.xep.XSLDriver "-DCONFIG=C:\Program Files\RenderX\XEP\xep.xml" %1 %2 %3 %4 %5 %6 %7 %8 %9
goto END

:WINNT
"C:\Program Files\Java\jre6\bin\java" -classpath "%CP%" com.renderx.xep.XSLDriver "-DCONFIG=C:\Program Files\RenderX\XEP\xep.xml" %*

:END


set CP=
6/ Added system environment variable:

Code: Select all

CLASSPATH=C:\XML_DTD\xml-commons-resolver-1.2\resolver.jar;C:\XML_DTD\CatalogManager.properties
But it doesn't work, the transformation in Oxygen still fails. Any idea of what I'd have missed?
Thanks & regards,
(Also posting this question on Xep support email list and maybe Yahoo dita users group).
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Issue with SVG DTD validation with XEP/Oxygen (Dita sour

Post by sorin_ristache »

Hello,
annetteb wrote:As indicated in xep user documentation, I tried to set up a catalog to have XEP validate with a local DTD but to no avail.
I think this is the correct way of fixing the SVG validation error in a PDF transformation.
annetteb wrote: 5/ Modified XEP batch script as follows:

Code: Select all

@echo off
rem This batch file encapsulates a standard XEP call.

set CP=C:\XML_DTD\xml-commons-resolver-1.2;C:\Program Files\RenderX\XEP\lib\xep.jar;C:\Program Files\RenderX\XEP\lib\saxon6.5.5\saxon.jar;C:\Program Files\RenderX\XEP\lib\saxon6.5.5\saxon-xml-apis.jar;C:\Program Files\RenderX\XEP\lib\xt.jar

. . .
Please add the C:\XML_DTD directory to the classpath and also make sure that resolver.jar is in the classpath:

Code: Select all

.  .  .

set CP=C:\XML_DTD\xml-commons-resolver-1.2\resolver.jar;C:\Program Files\RenderX\XEP\lib\xep.jar;C:\Program Files\RenderX\XEP\lib\saxon6.5.5\saxon.jar;C:\Program Files\RenderX\XEP\lib\saxon6.5.5\saxon-xml-apis.jar;C:\Program Files\RenderX\XEP\lib\xt.jar;C:\XML_DTD

. . .
annetteb wrote:6/ Added system environment variable:
I think this is ignored by the XEP batch process.
Regards,
Sorin

<oXygen/> XML Editor Support
annetteb
Posts: 24
Joined: Tue Apr 15, 2014 6:43 pm

Re: Issue with SVG DTD validation with XEP/Oxygen (Dita sour

Post by annetteb »

Hi Sorin,
Thanks for your reply.
I made the two changes you indicated but I still get the same error on transformation.

Regards,
Annette
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Issue with SVG DTD validation with XEP/Oxygen (Dita sour

Post by sorin_ristache »

Hi Annette,

What DOCTYPE declaration does the device_identification_label_SN.svg image file contain? Is it like the following?

Code: Select all

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
If yes the error coud have other cause than the DOCTYPE declaration in the SVG image file, which means it would be much better if you could send a small set of sample DITA XML files for reproducing the error: a sample DITA map file and the topics pulled into the map, including the SVG image file(s) but excluding the XEP processor files (xep.jar, xt.jar, xep.bat, etc).
Regards,
Sorin

<oXygen/> XML Editor Support
annetteb
Posts: 24
Joined: Tue Apr 15, 2014 6:43 pm

Re: Issue with SVG DTD validation with XEP/Oxygen (Dita sour

Post by annetteb »

The doctype is exactly the one you indicate.
I'll create a ZIP of my source files and send them to you.
Thanks,
Annette
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Issue with SVG DTD validation with XEP/Oxygen (Dita sour

Post by sorin_ristache »

Please send them.

Incidentally what does the XEP support team think about this error? Do they have a nice quick solution for you?
Regards,
Sorin

<oXygen/> XML Editor Support
annetteb
Posts: 24
Joined: Tue Apr 15, 2014 6:43 pm

Re: Issue with SVG DTD validation with XEP/Oxygen (Dita sour

Post by annetteb »

I haven't heard from them yet.
Annette
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Issue with SVG DTD validation with XEP/Oxygen (Dita sour

Post by sorin_ristache »

Hi Annette,

I confirm the error is in the device_identification_label_SN.svg image file. I still have some problems here with setting up the XML catalog for the XEP processor but I can give you a quick workaround for now: comment out the DOCTYPE declaration in the device_identification_label_SN.svg image file. I see that you already have the DOCTYPE declaration commented out in the other SVG files, so why not simply make device_identification_label_SN.svg consistent with the other image files? Like the following:

<!-- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -->
Regards,
Sorin

<oXygen/> XML Editor Support
annetteb
Posts: 24
Joined: Tue Apr 15, 2014 6:43 pm

Re: Issue with SVG DTD validation with XEP/Oxygen (Dita sour

Post by annetteb »

Hi Sorin,
As you guessed we commented out the doctype declaration to be able to generate PDFs. However I'd like to be able to generate PDFs with "correct" SVG files (that is, with the doctype declaration).
First because it's the best way to make sure our SVG files are valid (conform to the DTD). Later in our process, some of these SVG files will be translated and I think the DTD validation is very useful to make sure no error is introduced during translation.
Also, the writer working on the SVG files seem to have issues to open the files in the graphic editor when the doctype is commented. So today, he edits the xml, adds the doctype declaration, opens the file in Illustrator, then re-edits the xml and comment out the declaration. That's really time consuming.
That's the reason why I'm trying to solve the issue at XEP level. I hope XEP support team will be able to help on this as well.
Regards,
Annette
Radu
Posts: 9283
Joined: Fri Jul 09, 2004 5:18 pm

Re: Issue with SVG DTD validation with XEP/Oxygen (Dita sour

Post by Radu »

Hi Annette,

I answered you here:

https://groups.yahoo.com/neo/groups/dit ... ages/36136

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
annetteb
Posts: 24
Joined: Tue Apr 15, 2014 6:43 pm

Re: Issue with SVG DTD validation with XEP/Oxygen (Dita sour

Post by annetteb »

Hi Radu,
Thanks for the answer, I haven't been able to test it yet but will keep you informed if it works (or not).
Regards,
Annette
annetteb
Posts: 24
Joined: Tue Apr 15, 2014 6:43 pm

Re: Issue with SVG DTD validation with XEP/Oxygen (Dita sour

Post by annetteb »

Hi Radu,
I tested your solution and it works! Thanks a lot for your help!

BTW: I have to tell you that my coworker just started to work with Oxygen editor and find it very very handy. There are so many small features that are very useful and make our life much simpler. :D

Best regards,
Annette
annetteb
Posts: 24
Joined: Tue Apr 15, 2014 6:43 pm

Re: Issue with SVG DTD validation with XEP/Oxygen (Dita sour

Post by annetteb »

Sorin, thanks a lot for your help as well!
GSejourne
Posts: 15
Joined: Tue Mar 15, 2011 12:56 pm

Re: Issue with SVG DTD validation with XEP/Oxygen (Dita sour

Post by GSejourne »

Hi,

I'm having exactly the same problem as annetteb, and tried out the fix that was suggested on the yahoo group:
You'll find below the diff of what I changed in the build.xml file:

Code: Select all

diff --git a/demo/fo/build.xml b/demo/fo/build.xml
index 08cbcfe..1974b41 100644
--- a/demo/fo/build.xml
+++ b/demo/fo/build.xml
@@ -154,6 +152,8 @@ with those set forth herein.
<path id="xep.class.path">
<fileset dir="${xep.dir}/lib" includes="**/*.jar"/>
<pathelement location="${fo.lib.dir}/fo.jar"/>
+ <pathelement location="${lib.dir}/saxon/saxon-xml-apis.jar"/>
+ <pathelement location="${lib.dir}/resolver.jar"/>
</path>

<target name="preview.topic.pdf">
@@ -416,6 +416,11 @@ with those set forth herein.
<arg line='"${inputFile}" "${outputFile}" failOnError=${xep.failOnError}'/>
<classpath refid="xep.class.path"/>
<sysproperty key="com.renderx.xep.CONFIG" value="${xep.config.file}"/>
+
+ <!-- Add custom property to solve SVG dtd resolution-->
+ <sysproperty key="com.renderx.sax.entityresolver" value="org.apache.xml.resolver.tools.CatalogResolver"/>
+ <sysproperty key="xml.catalog.files" value="../../../catalog-dita.xml"/>
I didn't create a specific catalog file, but added the svg DTD to the existing catalog instead.

For now, I have commented out the doctype declaration in the svg files, but for the same reasons as Annetteb, I'd like to find a clean fix instead.

Thanks,

-Guillaume
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Issue with SVG DTD validation with XEP/Oxygen (Dita sour

Post by sorin_ristache »

GSejourne wrote:For now, I have commented out the doctype declaration in the svg files, but for the same reasons as Annetteb, I'd like to find a clean fix instead.
Adding the two sysproperty elements at the end of the ANT task that runs the XEP processor should be enough, since the resolver.jar is already in the classpath created by the Oxygen transformation.
GSejourne wrote:I didn't create a specific catalog file, but added the svg DTD to the existing catalog instead.
The second sysproperty element should point to an XML catalog file that resolves the DTD declaration in your SVG file.
GSejourne wrote:

Code: Select all

diff --git a/demo/fo/build.xml b/demo/fo/build.xml
Where is demo/fo/build.xml located more exactly? Is it the older PDF plugin in old versions of DITA-OT? In what Oxygen version do you get the error?
Regards,
Sorin

<oXygen/> XML Editor Support
Post Reply