|
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 |
|
This makes it easy to
Example:
Assuming basic.dsd contains:
<dsd xmlns="http://www.brics.dk/DSD/2.0"
xmlns:p="http://www.example.org/basic">
<if><element name="p:widget"/>
<declare>
<contents>
<repeat><element name="p:thingy"/></repeat>
</contents>
<attribute name="type"/>
</declare>
</if>
...
</dsd>
|
then we may use this schema in another schema:
...
<import href="basic.dsd"/>
<if>
<and>
<element name="p:widget"/>
<attribute name="type"><string value="small"/></attribute>
</and>
<require><contents>
<repeat max="7"><element name="p:thingy"/></repeat>
</contents></require>
<declare>
<attribute name="style"/>
</declare>
</if>
...
|
which means that a widget with type="small" can at most have 7 thingy child elements (restricting the basic definition), but additionally, it may have a style attribute (extending the basic definition).
|
| COPYRIGHT © 2000-2003 ANDERS MØLLER & MICHAEL I. SCHWARTZBACH |
|