← Prev in month ← Prev in thread

[ubl-ndrsc] Facets in CCTs with Attributes

From
Stuhec, Gunther <>
Date
2002-04-12T05:22:15+00:00
ID
731B98BB4B6CD311B1120008C75F20F20926D8EE@dewdfx27
Thread
[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
← Prev in month ← Prev in thread