Multiple line annotations in Relax NG are not converted
Posted: Tue Jan 10, 2006 5:00 pm
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:
Generated W3C XML 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:
Generated W3C XML SChema based on relax NG XML:
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
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 }
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>
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>
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>
Thanks in advance for any help,
Arjan Huijzer