January 2003
Beginner to intermediate
1200 pages
23h 42m
English
In fact, you can get even more powerful using the +, *, and ? operators inside sequences because, using parentheses, you can create subsequences—that is, sequences inside sequences.
For example, say that I wanted the <CUSTOMER> element to be capable of holding one or more <NAME> element. For each <NAME> element, I also want to allow a possible <CREDIT_RATING> element. I can do that like this, where I'm creating the subsequence (NAME,CREDIT_RATING?) and allowing that subsequence to appear one or more times in the <CUSTOMER> element:
<?xml version = "1.0" standalone="yes"?>
<!DOCTYPE DOCUMENT [
<!ELEMENT DOCUMENT (CUSTOMER)*>
<!ELEMENT CUSTOMER ((NAME,CREDIT_RATING?)+,DATE*,ORDERS)> ... |