Okay - been playing most of the night - trying to build an XSD for this
stuff.  I first tried my preferred "one tag" way.  This works... but the XSD
isn't very detailed.  Since you can't define constraints based on attribute
values I can't describe some rules I'd like.  For example:

+) If the type attribute is 'string' only allow simple content.

+) If the type attribute is 'object' the 'fields' attribute is required,
otherwise it's optional.

So I decided to give your idea a try: a separate tag for each datatype.
However the issue here is that (seemingly) you _must_ define an indicator
("all", "choice" or "sequence") for complex types and that's just too damn
restrictive.

I would want to do something like this:

<object fields="fname,lname,dob,address,age">
        <string>Jim</string>
        <string>Davis</string>
        <date>1971-04-23</date>
        <object>...</object>
        <number>32</number>
</object>

Basically an "object" type should be able to hold any number of any other
type in any order I damn well please - but none of the indicators allow
this.

I really don't want to enforce a type grouping on the serialization... damn
that would be a huge pain in the ass.

I could use <any tag>... but hell, that doesn't offer me anything that using
a single <data> tag doesn't.  In both cases I get no validation of nested
content.

Now I can describe this in a DTD but I know we're supposed to be getting
away from DTDs (another case of the W3C creating a replacement for something
that can't do everything the thing its replacing can do).

Using just the single <data> tag I could describe this in an XSD (zero or
more data tags in sequence) - but I'd have to live with really weak
structural validation.

Although in either case it looks like the XSD doesn't describe as much as
I'd like so I'll have to define at least some application-level validation
rules/assumptions.

Any ideas for getting around this?

Thanks,

Jim Davis






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:5:169489
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/5
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:5
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.5
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to