Using DITA-OT with RNG files?

270 views
Skip to first unread message

Frank Ralf

unread,
Mar 30, 2015, 5:03:19 AM3/30/15
to dita-o...@googlegroups.com
I want to transform DITA RNG files with a standalone DITA-OT version (1.8.5). Transforming the files with oXygen 16.1 which also comes with DITA-OT 1.8.5 is no problem. I'm using an Ant build script according to http://www.dita-ot.org/1.8/readme/creating-an-ant-build-script.html but my first try was not successfull. Do I have to set any other parameters for RNG files?

TIA
Frank

Frank Ralf

unread,
Mar 30, 2015, 11:26:44 AM3/30/15
to dita-o...@googlegroups.com
I've had a look at the batch file that sets the environment variables for the DITA-OT (https://github.com/dita-ot/dita-ot/blob/develop/src/main/startcmd.bat) to see whether one can teach Xerces some RELAX NG by using Jing or ManeniNeko but don't have any clue how to achieve this. Any pointers welcome :-)

Frank

Frank Ralf

unread,
Mar 30, 2015, 11:30:23 AM3/30/15
to dita-o...@googlegroups.com
I also thought about borrowing something from Eliot Kimber's build file for his RNG conversion tool:
https://tools.oasis-open.org/version-control/svn/dita/doctypes/tools/relaxng/build.xml

que...@gmail.com

unread,
Mar 30, 2015, 3:15:26 PM3/30/15
to dita-o...@googlegroups.com
What type of transformation do you want to do? Is it the actual RNG files that you want to transform? Since you are mentioning Jing, I think it might be that you want to transform some files that are validated against RNG schemas. Or, since you mention a conversion script from Eliiot Kimber, maybe you mean you have DITA source and you want to process it using a DITA 1.3 document type shell?

Kendall

George Bina

unread,
Mar 30, 2015, 4:28:33 PM3/30/15
to dita-o...@googlegroups.com
Hi Frank,

Please see
https://dita-ng.googlecode.com/svn/trunk/doc/DITA-NG.pdf
The first slides describe how you can use Relax NG schemas with DITA-OT
to get the default class and domains values added automatically.
Basically, all you need is to add 2 Java libraries in the classpath of
the DITA-OT.

Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 30/03/15 18:26, Frank Ralf wrote:
> I've had a look at the batch file that sets the environment variables
> for the DITA-OT
> (https://github.com/dita-ot/dita-ot/blob/develop/src/main/startcmd.bat)
> to see whether one can teach Xerces some RELAX NG by using Jing
> <http://www.thaiopensource.com/relaxng/jing.html> orManeniNeko
> <http://people.apache.org/~andyc/neko/doc/relaxng/> but don't have any
> clue how to achieve this. Any pointers welcome :-)
>
> Frank
>
>
>
>
>
>
>
>
>
>
> On Monday, March 30, 2015 at 11:03:19 AM UTC+2, Frank Ralf wrote:
>
> I want to transform DITA RNG files with a standalone DITA-OT version
> (1.8.5). Transforming the files with oXygen 16.1 which also comes
> with DITA-OT 1.8.5 is no problem. I'm using an Ant build script
> according to
> http://www.dita-ot.org/1.8/readme/creating-an-ant-build-script.html
> <http://www.dita-ot.org/1.8/readme/creating-an-ant-build-script.html> but
> my first try was not successfull. Do I have to set any other
> parameters for RNG files?
>
> TIA
> Frank
>
> --
> You received this message because you are subscribed to the Google
> Groups "DITA-OT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to dita-ot-user...@googlegroups.com
> <mailto:dita-ot-user...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Frank Ralf

unread,
Mar 31, 2015, 3:56:55 AM3/31/15
to dita-o...@googlegroups.com
Hi George,

Many thanks for the pointer. Radu and Eliot have already answered but strangely their posts don't show here. I will post their responses here for others interested in the topic as soon as I have access to my private mail.

Kind regards,
Frank

Frank Ralf

unread,
Mar 31, 2015, 5:48:17 AM3/31/15
to dita-o...@googlegroups.com
Hi George,

Many thanks for your thorough instructions and explanations regarding DITA and Relax NG. I followed your instructions but unfortunately the build still fails. I'm using DITA-OT 1.8.5 (Full easy install) together with the latest version of DITA NG (dita-ng20130417.zip).

I've modified startcmd.bat according to your instructions by adding the following line:

set CLASSPATH=%DITA_DIR%plugins\org.dita-ng.doctypes\lib\ditang.jar;%DITA_DIR%plugins\org.dita-ng.doctypes\lib\jing.jar;%CLASSPATH%

I've also checked catalog-dita.xml after running the integrator script that the DITA RNG plugin is indeed integrated. I get the following error message:

gen-list:
 [gen-list] GenMapAndTopicListModule.execute(): Starting...
 [gen-list] Using Xerces grammar pool for DTD and schema caching.
 [gen-list] Processing C:\DITA-OT1.8.5\plugins\org.dita-ng.doctypes\demo\flowers\flowers.ditamap
 [gen-list] GenMapAndTopicListModule.execute(): Execution time: 203 milliseconds

BUILD FAILED
C:\DITA-OT1.8.5\build_rng.xml:16: The following error occurred while executing this line:
C:\DITA-OT1.8.5\build.xml:44: The following error occurred while executing this line:
C:\DITA-OT1.8.5\plugins\org.dita.base\build_preprocess.xml:24: Failed to run pipeline: [DOTJ012F][FATAL] Failed to parse
 the input file 'C:\DITA-OT1.8.5\plugins\org.dita-ng.doctypes\demo\flowers\flowers.ditamap'. The XML parser reported the
 following error: : flowers.ditamap Line 4:cvc-elt.1.a: Cannot find the declaration of element 'map'.

It looks like the two additional jar files aren't working properly.

Kind regards,
Frank






On Monday, March 30, 2015 at 10:28:33 PM UTC+2, George Bina wrote:

Radu Coravu

unread,
Mar 31, 2015, 6:44:54 AM3/31/15
to Frank Ralf, dita-o...@googlegroups.com
Hi Frank,

Could you try to see if setting the parameter "validate"="no" is enough for the topic files in the temporary output folder to have the @class attribute set to them.

Regards,
Radu

--
You received this message because you are subscribed to the Google Groups "DITA-OT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-user...@googlegroups.com.

Frank Ralf

unread,
Mar 31, 2015, 7:56:21 AM3/31/15
to dita-o...@googlegroups.com, frank...@gmx.de
Hi Radu,

I've set <property name="validate" value="false" /> in the build file. The build still fails and I don't get any files in the /temp folder. The error message indicates that indeed the class attributes are missing:

gen-list:
 [gen-list] GenMapAndTopicListModule.execute(): Starting...
 [gen-list] [DOTJ037W][WARN] The XML schema and DTD validation function of the parser is turned off. Please make sure th
e input is normalized DITA with class attributes included, otherwise it will not be processed correctly.

 [gen-list] Using Xerces grammar pool for DTD and schema caching.
 [gen-list] Processing C:\DITA-OT1.8.5\plugins\org.dita-ng.doctypes\demo\flowers\flowers.ditamap
 [gen-list] [DOTJ030I][INFO] No 'class' attribute for was found for element '<map>'. This generally indicates that your
DTD or Schema was not developed properly according to the DITA specification.
 [gen-list] [DOTJ030I][INFO] No 'class' attribute for was found for element '<topicref>'. This generally indicates that
your DTD or Schema was not developed properly according to the DITA specification.

George Bina

unread,
Mar 31, 2015, 8:00:23 AM3/31/15
to dita-o...@googlegroups.com
Hi Frank,

Have you seen my reply? It looks like you did not get the libraries in
your classpath and thus the Relax NG code is not actually used.

Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

> --
> You received this message because you are subscribed to the Google
> Groups "DITA-OT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to dita-ot-user...@googlegroups.com
> <mailto:dita-ot-user...@googlegroups.com>.

Frank Ralf

unread,
Mar 31, 2015, 8:00:37 AM3/31/15
to dita-o...@googlegroups.com, frank...@gmx.de
In addition, I didn't get this detailed error message when trying the same transformation without the modifications as per George's instructions. So I suppose at least one of the additional jar files does work.

Kind regards,
Frank

Frank Ralf

unread,
Mar 31, 2015, 8:22:15 AM3/31/15
to dita-o...@googlegroups.com
Hi George,

No, I haven't seen your reply, Google Groups behaves quite strange sometimes :-(

But you are right and I found the culprit. I had copied the lines for the CLASSPATH settings from your PDF file and because of a line break in the PDF it came out as

DITA_DIR/plugins/org.dita-ng.doctypes/lib/ditang.jar (hyphen missing) instead of .../dita-ng.jar. After amending that everything works perfectly. Many thanks for your kind help.

Kind regards,
Frank

Frank Ralf

unread,
Apr 1, 2015, 4:04:47 AM4/1/15
to dita-o...@googlegroups.com
JFTR, Google Groups is a real PITB. At least three responses to this thread never made it onto this webpage! Here's the one from Radu which probably would have saved all of us a lot of time and trouble if it had shown here :-(

Many thanks again to all of you for your kind help!

Cheers,
Frank

=======================================

Betreff:         Re: [dita-ot] Using DITA-OT with RNG files?
Datum:   Mon, 30 Mar 2015 12:39:40 +0300
Von:     Radu Coravu
An:      Frank Ralf


Hi Frank,

When Oxygen starts the ANT Java process it sets a custom XML parser
configuration class via a system property:

-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.ditang.relaxng.defaults.RelaxDefaultsParserConfiguration

What happens is that each time a Xerces parser is created to parse XML,
it reads reads the "org.apache.xerces.xni.parser.XMLParserConfiguration"
system property and if it is set, the value of the property is used to
instantiate a custom parser configuration. In our case the parser
configuration implementation knows how to parse RNG schemas using Jing
and to report default attributes for the topics with attached RNG.

The DITA NG Project has two JAR libraries, one is Jing and the other one
contains the custom parser configuration.
George Bina's PDF explains how the DITANG project + any DITA OT
distribution can be used to publish RNG-based topics and maps to any output:

https://dita-ng.googlecode.com/svn/trunk/doc/DITA-NG.pdf

Regards,
Radu

Frank Ralf

unread,
Aug 26, 2015, 10:06:06 AM8/26/15
to DITA-OT Users
Hi,

For a current project we will be using DITA-OT 2.0 with DITA 1.3 (RNG). Do current versions of the DITA-OT come with support for RELAX NG (RNG) or do I have to follow the instructions given above?

Kind regards,
Frank

Kendall Shaw

unread,
Aug 26, 2015, 11:01:01 PM8/26/15
to DITA-OT Users
I think I can safely say that it does not, if support means relax ng parsing included.

The dita-ng plugin that was on googlecode appears to work with DITA-OT 2.0.

Kendall
--
You received this message because you are subscribed to the Google Groups "DITA-OT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-user...@googlegroups.com.

Frank Ralf

unread,
Aug 28, 2015, 3:20:12 AM8/28/15
to DITA-OT Users

Hi Kendall,

Thanks for this information. Eliot Kimber has requested to integrate the parsing code into the DITA-OT:

"Support RELAXNG parsing and validation"
https://github.com/dita-ot/dita-ot/issues/2019 

Kind regards,
Frank
Reply all
Reply to author
Forward
0 new messages