RELAX NG by Eric van der Vlist will be published by O'Reilly & Associates (ISBN: 0596004214)
You are welcome to use our annotation system to give your feedback.
RELAX NG uses named patterns to address both modularity and recursion. Patterns can both have names and reference other patterns by name.
In the XML syntax, named patterns are defined using define elements. When we define named patterns, in this case one that is called name, that we want to have contain our nameelement, we would thus write:
<define name="name-element"> <element name="name"> <text/> </element> </define> |
The compact syntax uses a construction similar to a programming language format. The same definition would be written as:
name-element = element name {text} |
We are not limited to embedding a single element or attribute definition in a named pattern. Note that a group, shown in Figure�2, composed of an id attribute, a name element and an optional born element are present in the same order and with the same definition in both the author and the character element:
<define name="common-content"> <attribute name="id"/> <element name="name"> <text/> </element> <optional> <element name="born"> <text/> </element> </optional> </define> |
or:
common-content = attribute id { text }, element name { text }, element born { text }? |
You are welcome to use our annotation system to give your feedback.
[Annotations for this page]
All text is copyright Eric van der Vlist, Dyomedea. During development, I give permission for non-commercial copying for educational and review purposes. After publication, all text will be released under the Free Software Foundation GFDL.