[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: Re: [relax-ng] Conversion of comments between the compact and the XMLsyntax
>> It seems to me that the annotation should be included in what is >> described (especially if you want to extract documentation) and that if >> I want to document a complex regular expression within a pattern, the >> annotation should be included in the "pattern" element rather than >> following it. > > Why? The spec (DTD Compatibility) explicitly allows a:documentation to > follow the RELAX NG element to which it applies. This done precisely to > allow annotation of param/value/name. Also note that Trang supports this. For example, this RNG <element name="foo" 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"> <data type="string"> <param name="pattern">[A-Za-z]+</param> <a:documentation>Any letter</a:documentation> </data> </element> will turn into this XSD <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="foo"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:pattern value="[A-Za-z]+"> <xs:annotation> <xs:documentation>Any letter</xs:documentation> </xs:annotation> </xs:pattern> </xs:restriction> </xs:simpleType> </xs:element> </xs:schema> James
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC