[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: Re: [ubl-ndrsc] Facets in CCTs with Attributes
Having a simple type corresponding to the "content" of the complex type seems to make sense to me. We have a principle about naming our types so that they're reusable, and naming them also makes them extensible/restrictable. So I say yes... Eve Stuhec, Gunther wrote: > Hello all, > > I'am trying to realize some possible schemas for each CCT and I have > recognized a problem. > If I define a complexType for a CCT like the following "AmountType", it is > not possible to insert some facets for restriction of the leaf element > content. In the following example, it is possible to restrict the attributes > by using the facets only. > > <complexType name="AmountType" id="000105"> > <simpleContent> > <extension base="decimal"> > <attribute name="currencyId" use="required" > id="000107"> > <simpleType> > <restriction base="string"> > <length value="3"/> > </restriction> > </simpleType> > </attribute> > <attributeGroup ref="cct:commonAttributes"/> > </extension> > </simpleContent> > </complexType> > > If I would like to restrict the element content itself, I can do that, if I > define an additional simpleType for that element content (like > "AmountContentType"). > > <xsd:simpleType name="AmountContentType"> > <xsd:restriction base="xsd:decimal"> > <xsd:totalDigits value="10"/> > <xsd:fractionDigits value="2"/> > </xsd:restriction> > </xsd:simpleType> > > I can insert some additional facets in this simpleType and refer to that > simpleType inside of complexType "AmountType": > > <complexType name="AmountType"> > <simpleContent> > <extension base="cct:AmountContentType"> > <attribute name="currencyId" use="required" > id="000107"> > <simpleType> > <restriction > base="xsd:string"> > <maxLength > value="3"/> > </restriction> > </simpleType> > </attribute> > <attributeGroup ref="cct:commonAttributes"/> > </extension> > </simpleContent> > </complexType> > > Is that suggested way the most elegant way? Or, can I express the attributes > and the restrictions for the content of leaf elements in only one defined > complexType? > > Regards, > > Gunther > > ---------------------------------------------------------------- > To subscribe or unsubscribe from this elist use the subscription > manager: <http://lists.oasis-open.org/ob/adm.pl> > -- Eve Maler +1 781 442 3190 Sun Microsystems XML Technology Center eve.maler @ sun.com
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC