by Eric van der Vlist is published by O'Reilly & Associates (ISBN: 0596004214)
Now we have all the components needed to convert the full RELAX NG schema from Chapter 3 into its compact syntax form; it's shown in Example 4-1.
Example 4-1. Compact syntax of full RELAX NG schema
element library {
element book {
attribute id { text },
attribute available { text },
element isbn { text },
element title {
attribute xml:lang { text },
text
},
element author {
attribute id { text },
element name { text },
element born { text }?,
element died { text }?
}+,
element character {
attribute id { text },
element name { text },
element born { text }?,
element qualification { text }
}*
}+
} |
In the following chapters, I give both the XML and the compact syntax for each example. You'll have plenty of opportunities to get familiar with both.
![]() | Tip |
|---|---|
Don't get confused by the similarities in name between the simple form of a RELAX NG schema, described in Chapter 15, and the compact syntax. These two notions work at different levels: the simple form is the result of simplifications performed internally by RELAX NG processors on the data model of the schema; the compact syntax is a different way to represent or serialize a full RELAX NG document. The data models that result from the parsing of a full RELAX NG schema are thus the same whether the schema is written using the XML or the compact syntax and are simplified into the same simple schema. | |
This text is released under the Free Software Foundation GFDL.