element event {
(element date {text} | attribute {text})
}
The <event> element above allows the author to either insert a
<event>
<date>2004-10-15</date>
</event>
Or
<event date="2004-10-15"/>
You can't do this with either DTDs or XSD. Why would you want to give this option? In some situations, you may find that clients differ between using elements or attributes. One client may not want to process any attributes, preferring instead to put everything in elements, while another may prefer mixing elements and attributes in a more traditional way. In RNG, you can cover both methods in the same schema.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.