Multiple line annotations in Relax NG are not converted

Having trouble installing Oxygen? Got a bug to report? Post it all here.
huijzer
Posts: 3
Joined: Thu Jan 05, 2006 2:22 pm

Multiple line annotations in Relax NG are not converted

Post 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
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post 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
huijzer
Posts: 3
Joined: Thu Jan 05, 2006 2:22 pm

Post by huijzer »

Thanks for the reply.
Post Reply