NOTE:
These slides have not been updated since 2003. They have been superseded by the book
Anders Møller and Michael Schwartzbach, February 2006 |
THE XML REVOLUTION - TECHNOLOGIES FOR THE FUTURE WEB |
Regular expressions can be built from:
Example:
... <union> <string value="*"/> <stringtype ref="r:NUMBER"/> </union> ... <stringtype id="r:DIGITS"> <repeat min="1"> <char min="0" max="9"/> </repeat> </stringtype> <stringtype id="r:NUMBER"> <sequence> <stringtype ref="r:DIGITS"/> <optional> <sequence> <string value="."/> <stringtype ref="r:DIGITS"/> </sequence> </optional> </sequence> </stringtype> |
Libraries of common expressions can be made with the import feature described later...
If multiple regular expressions are declared for the contents of an element, they are implicitly combined by projection:
<contents> <sequence> <element name="p:a"/> <element name="p:b"/> </sequence> </contents> <contents> <sequence> <element name="p:a"/> <optional><element name="p:c"/></optional> </sequence> </contents> |
Here, an a element must be followed by a b element and optionally by a c element, but the b and c elements can appear in any order.
COPYRIGHT © 2000-2003 ANDERS MØLLER & MICHAEL I. SCHWARTZBACH |