OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   RE: Why ANY isn't more restrictive?

[ Lists Home | Date Index | Thread Index ]
  • From: Aleksi Niemelš <aleksi.niemela@cinnober.com>
  • To: "'xml-dev@xml.org'" <xml-dev@xml.org>
  • Date: Thu, 10 Feb 2000 17:14:53 +0100

From: Bob Kline [mailto:bkline@rksystems.com]:

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.


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:


instead of:
	<foo_child_type_object named="bar">
	<foo_child_type_object named="cuz"/>

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">
		<any maxOccurs="*"/>

And schema for the latter is easy too:

<element name="foo">
		<element name="foo_child_type_object" type="foo_child_type"

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">
		<any type="foo_child_type" maxOccurs="*"/>

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


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS