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

 


Help: OASIS Mailing Lists Help | MarkMail Help

ubl-ndrsc message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Subject: [ubl-ndrsc] Facets in CCTs with Attributes


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


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Powered by eList eXpress LLC