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 |
<dsd xmlns="http://www.brics.dk/DSD/2.0" xmlns:r="http://recipes.org" root="r:collection"> <if><element name="r:collection"/> <declare><contents> <element name="r:description"/> <repeat><element name="r:recipe"/></repeat> </contents></declare> </if> <if><element name="r:description"/> <rule ref="r:ANYCONTENT"/> </if> <if><element name="r:recipe"/> <declare><contents> <sequence> <element name="r:title"/> <repeat><element name="r:ingredient"/></repeat> <element name="r:preparation"/> <element name="r:nutrition"/> </sequence> <optional><element name="r:comment"/></optional> </contents></declare> </if> <if><element name="r:ingredient"/> <declare> <required><attribute name="name"/></required> <attribute name="amount"> <union> <string value="*"/> <stringtype ref="r:NUMBER"/> </union> </attribute> <attribute name="unit"/> </declare> <if><not><attribute name="amount"/></not> <require><not><attribute name="unit"/></not></require> <declare><contents> <repeat min="1"><element name="r:ingredient"/></repeat> <element name="r:preparation"/> </contents></declare> </if> </if> <if><element name="r:preparation"/> <declare><contents> <repeat><element name="r:step"/></repeat> </contents></declare> </if> <if> <or> <element name="r:step"/> <element name="r:comment"/> <element name="r:title"/> </or> <declare><contents> <string/> </contents></declare> </if> <if><element name="r:nutrition"/> <declare> <required> <attribute name="protein"><stringtype ref="r:NUMBER"/></attribute> <attribute name="carbohydrates"><stringtype ref="r:NUMBER"/></attribute> <attribute name="fat"><stringtype ref="r:NUMBER"/></attribute> <attribute name="calories"><stringtype ref="r:NUMBER"/></attribute> </required> <attribute name="alcohol"><stringtype ref="r:NUMBER"/></attribute> </declare> </if> <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> <rule id="r:ANYCONTENT"> <declare><contents> <repeat><union><element/><string/></union></repeat> </contents></declare> </rule> </dsd> |
Notice in particular:
One can check that this is indeed a DSD by validating it with the meta-DSD.
COPYRIGHT © 2000-2003 ANDERS MØLLER & MICHAEL I. SCHWARTZBACH |