W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2006

Re: Tagging the remainder of a body

From: Paul Monday <Paul.Monday@Sun.COM>
Date: Tue, 14 Feb 2006 07:12:37 -0700
To: Michael Kay <mike@saxonica.com>
Cc: xmlschema-dev@w3.org
Message-id: <43F1E555.5010207@sun.com>

Thanks everyone, maybe I know XML Schema better than I thought :-)  The 
Schematron thoughts are new to me though, I will look into it and also 
restructure my XML to just use choice.

Paul Monday
Sun Microsystems

Michael Kay wrote:
> XMLSchema defines a magic attribute xsi:type that can be used for this kind
> of purpose. Unfortunately you can't use your own element/attribute or define
> its range of values: this is one of the fundamental constraints of the XML
> Schema specification.
>
> Michael Kay
> http://www.saxonica.com/ 
>
>
>
>   
>> -----Original Message-----
>> From: xmlschema-dev-request@w3.org 
>> [mailto:xmlschema-dev-request@w3.org] On Behalf Of Paul B. Monday
>> Sent: 14 February 2006 04:13
>> To: xmlschema-dev@w3.org
>> Subject: Tagging the remainder of a body
>>
>>
>> I'm trying to leave a "type" tag in a body that determines the latter 
>> half of an XML instance.  I can't find a decent way to do this but am 
>> thinking I'm tackling the problem wrong from the outset.  
>> Basically, I 
>> want to be able to enforce that if a type is "Event", the 
>> latter half of 
>> the message has an event but if the type is "Contact", the 
>> latter half 
>> of the message has contact information...like this:
>>
>> <message>
>>     <type>Event</type>
>>     <event>
>>        <stuff></stuff>
>>     </event>
>> </message>
>>
>> <message>
>>     <type>Contact</type>
>>     <contact-information>
>>        <address></address>
>>     </contact-information>
>> </message>
>>
>>
>> Am I approaching this wrong for XML?  Is there anyway to 
>> constrain the 
>> following nodes like this?  selector, nor choice seem to allow this 
>> linkage to occur...I'm not necessarily "new" to schema, but 
>> neither am I 
>> "advanced" in schema...so apologies if this question seems naive...
>>
>> Paul Monday
>> Sun Microsystems
>>
>>
>>
>>     
>
>
>   
Received on Tuesday, 14 February 2006 14:13:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:53 GMT