Full Schema
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.
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.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access