<copyright date="2004-10-15"/>
In XSD, define the empty content model as follows:
<xsd:element name="copyright">
<xsd:complexType>
<xsd:attribute name="date" type="xsd:date"/>
</xsd:complexType>
</xsd:element>
Note that there's no child element in this content model, only an attribute name. The attribute uses the xsd:date datatype to constrain the value of the attribute to the lexical date (CCYY-MM-DD). If you don't want to constrain the date value, you can use xsd:string instead. You can now insert a copyright tag with a date attribute in your document without specifying additional content.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.