Re: Schema help

Well, if you're just counting bits:

<task><taskType1></taskType1>...</task>

doesn't seem vastly different to:

<task taskType="Type1">...</task>

Verbosity is pretty much the nature of the XML beast, and basing your
modelling on reducing that in general seems the wrong way to do things.

On further reflection though, I think one of the original solutions based 
the answer on deriving from task with type xs:anyType.  I didn't like that 
because it seemed to take semantic meaning away from the tag and place it 
with the attribute value.  But I think what the original poster to this 
thread wants is to define a type that encompasses all tasks and have that as 
the type of 'task' and then use xs:restriction to constrain to a particular 
type of task (with xsi:type).  That approach constrains what can be included 
in the type referenced by xsi:type and I'm more comfortable with that.

Pete.
=============================================
Pete Cordell
http://www.xml2cpp.com
=============================================
----- Original Message ----- 
From: "Bryan Rasmussen" <brs@itst.dk>
To: "'Pete Cordell'" <petexmldev@tech-know-ware.com>
Cc: <xmlschema-dev@w3.org>
Sent: Tuesday, November 15, 2005 8:52 AM
Subject: SV: Schema help


>
>
>
>
>
>>Yes, this has come up a number of times recently, but I personally didn't
>>find the solutions particularly appealing!
>
>>Maybe people that want to do this sort of thing should consider
> re-modelling
>>their data so that it works to XSD's strengths.
> I found this amusing in a twisted way, it struck me that working to XSD's
> strengths was synonymous with producing particularly ugly XML.
>
>><task>
>>    <!-- common task elements here -->
>>    <taskType1>
>>        <!-- Task 1 things -->
>>    </taskType1>
>></task>
>
>>or:
>
>><task>
>>    <!-- common task elements here -->
>>    <taskType2>
>>        <!-- Task 1 things -->
>>    </taskType2>
>></task>
>
> I'm sorry but are you suggesting that task has a choice of taskType1
> taskType2 and so forth? Sometimes I think the worse thing that was ever
> put
> in the xml spec was that thing about verbosity not being a problem.
>
>
> Of course I've been ranting this for years (the anti xml schema stuff),
> they
> called me mad at the academy, etc. etc.
>
> Cheers,
> Bryan Rasmussen
>
>

Received on Tuesday, 15 November 2005 09:34:21 UTC