Page 1 of 1

Multiple line annotations in Relax NG are not converted

Posted: Tue Jan 10, 2006 5:00 pm
by huijzer
Hi all,

I use Relax NG compect syntax to write my schemas and then I convert them using Oxygen into W3C XML Schemas. I have encountered a problem, namely that multiple line annotations are not converted.

Example Relax NG Compact:

Code: Select all


start = nameElement

nameElement =
## This is the first line.
## This is the second line.
element name { xsd:string }
Generated W3C XML Schema

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="name" type="xs:string"/>
</xs:schema>
However, when I translate the compact syntax into the XML syntax and then into W3C XML Schema, I get the schema with annotations:

Relax NG XML:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<start>
<ref name="nameElement"/>
</start>
<define name="nameElement">
<element name="name">
<a:documentation>This is the first line.
This is the second line.</a:documentation>
<data type="string"/>
</element>
</define>
</grammar>
Generated W3C XML SChema based on relax NG XML:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="name" type="xs:string">
<xs:annotation>
<xs:documentation>This is the first line.
This is the second line.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:schema>
Is there a way to generate the W3C XML Schemas directly from the compact syntax without having to translate it in the XML syntax as an intermidiate step?

Thanks in advance for any help,

Arjan Huijzer

Posted: Tue Jan 10, 2006 5:32 pm
by george
Hi Arjan,

oXygen uses TRANG [1] for these conversions and the problem seems to be inside TRANG as I can reproduce the same behaviour from command line.

[1] http://www.thaiopensource.com/relaxng/trang.html

Best Regards,
George

Posted: Wed Jan 11, 2006 1:07 pm
by huijzer
Thanks for the reply.