[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Restricted element content

From: Vity <vitywap@seznam.cz>
Date: Thu, 12 Mar 2009 15:25:17 +0100
To: <xmlschema-dev@w3.org>
Message-ID: <F8583F68D91A4E32BBD7EA52D23005E3@stroj>
RE: Restricted element content
I thought that. Thank you Pete and Michael for your expert answers.

-Vity

> -----Original Message-----
> From: Pete Cordell [mailto:petexmldev@codalogic.com] 
> Sent: Thursday, March 12, 2009 2:00 PM
> To: Vity; xmlschema-dev@w3.org
> Subject: Re: Restricted element content
> 
> Sadly the best you can do with this is define a complex type 
> with complex 
> content that is mixed.  You have no control over the type of 
> TEXT data 
> within the mixed content, or even where it is placed.
> 
> I've often thought it would be nice to have an xs:text 
> element that was 
> analogous to an xs:element, but didn't have start and end 
> tags.  You could 
> then do:
> 
> <xs:complexType name='fooType'>
>     <xs:sequence>
>         <xs:text type='xs:int'/>
>         <xs:element name='bar1'/>
>         <xs:element name='bar2'/>
>     </xs:sequence>
>     <xs:attribute name='atr1' type='xs:string'/>
> </xs:complexType>
> 
> But I've never sat down and thought through the implications 
> of this so have 
> never formally proposed it.  I would be interested to hear 
> whether anybody 
> else has thought it through though.
> 
> Interestingly (or otherwise) a complex type with simple 
> content could be 
> expressed as:
> 
> <xs:complexType name='fooType'>
>     <xs:sequence>
>         <xs:text type='xs:int'/>
>     </xs:sequence>
>     <xs:attribute name='atr1' type='xs:string'/>
> </xs:complexType>
> 
> and I wonder whether that could simplify the specs.
> 
> Anyway HTH,
> 
> Pete Cordell
> Codalogic Ltd
> Interface XML to C++ the easy way using XML C++
> data binding to convert XSD schemas to C++ classes.
> Visit http://codalogic.com/lmx/ for more info
> 
> ----- Original Message ----- 
> From: "Vity" <vitywap@seznam.cz>
> To: <xmlschema-dev@w3.org>
> Sent: Wednesday, March 11, 2009 6:17 PM
> Subject: Restricted element content
> 
> 
> >
> > Hello,
> > I have very simple question, but I cannot find a solution for this.
> > I would like to create XSD, which would describe following 
> piece of XML:
> > <foo atr1="some restricted attribute">
> >  --limited string length (or eg. positive integer)-- 
> >  <bar1 />
> >  <bar2 />
> > </foo>
> >
> > =element with an attribute which contains restricted 
> content and other
> > elements.
> >
> > I have no problem to describe the XML without "bar" 
> elements, but it seems
> > to have no solution with them.
> >
> > Thanks in advance.
> >
> > -Vity
> >
> >
> >
> > 
> 
> 
Received on Thursday, 12 March 2009 14:27:01 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.