[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Mixed content in data-binding (Was: Re: Interest
> Michael Kay wrote: > > > > <email>fred@s...<last-modified>2005-02-02</last-modif > ied></email> > > I don't like this example. As I see it the natural interpretation of > this construct is that the e-mail address is > fred@s...2005-02-02. I don't think this is a good use of a > mixed content. I agree there's a convention with document-oriented XML that if you remove all the tags, you are left with a human readable piece of text that makes sense. But this convention is often breached, and we're basically free to use the syntactic constructs of XML in any way we wish. Here I'm supposing a recursive pair of relationships: A property has zero-or-more annotations An annotation is a property And I'm also assuming that most properties have no annotations. In this scenario I think that modelling it as above would be very reasonable - if only I could describe the rules in a schema (which I can't). >I would write this construct as: >> >> <email>fred@s...</email> >> <last-modified>2005-02-02</last-modified> This doesn't meet the aim of allowing the structure to be recursive. In my example the annotation appeared after the value of the property, and applies to the value as a whole, but I wouldn't want to impose that limitation. One could also have <date-of-birth>1583<alternative-reading>1588</alternative-reading>-05-12</da te-of-birth> Part of the design aim is that an XML document with no annotations looks exactly how it would have looked if annotations were not possible. Michael Kay http://www.saxonica.com/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|