|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Why ANY isn't more restrictive?
From: Bob Kline [mailto:bkline@r...]: I'd like to try and make sure that people aren't ignoring his request because they think no one else is interested in the answer. I'm interested, and have a number of cases which would benefit significantly from the modification he proposes. Me: While I see need for non-restrictive ANY I have needs to restrict ANY a little bit. I think I asked this before Y2K or after that, and got some response. But I have to say I'm facing this problem again and again. Basically I like to write *by hand* in a shorthand form for two reasons. It's much easier to read and understand and quite much faster to type. So I like this: <foo> <bar> <bar_childs/> </bar> <cuz/> </foo> instead of: <foo> <foo_child_type_object named="bar"> <bar_childs/> </foo_child_type_object> <foo_child_type_object named="cuz"/> </foo> Yup, I know I could use XSLT to translate between these forms but I feel it's really an overkill. Think about slim servlet reading user's typing and responding on that: first it performs XSL Transformation just to be able to check correctness. It should be dead simple to write proper schema for the first one (I can't recall can you say maxOccurs for any, or do you have to make a container for <bar> and <cuz> - wrapping is going to kill the user even more): <element name="foo"> <type> <any maxOccurs="*"/> <type> </element> And schema for the latter is easy too: <element name="foo"> <type> <element name="foo_child_type_object" type="foo_child_type" maxOccurrs="*"/> <type> </element> What I would like to say is "expect any well-formed XML which is correct according [some type definition | maybe other schema]": <element name="foo"> <type> <any type="foo_child_type" maxOccurs="*"/> <type> </element> How come I can't specify anything for any, even in the case where we really know what foo_child_typed elements should contain. Doesn't anybody else hit his head on this wall? - Aleksi
|
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
|
|||||||||

Cart








