W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2001

schema help needed (3 questions)

From: sk ask <arigapudi_s@yahoo.com>
Date: Wed, 5 Dec 2001 04:39:33 -0500 (EST)
Message-ID: <20011205093911.37619.qmail@web13502.mail.yahoo.com>
To: xmlschema-dev@w3.org
Hi,
  I have lots of elements like that below. So,
I would like to define a type and reuse it. Not
sure how to give different values to min and
max Exclusive facets each time. Is it possible to
do that?


<xsd:element name="Elevation">
						<xsd:complexType>
							<xsd:simpleContent>
								<xsd:restriction base="xsd:double">
									<xsd:attribute name="value" default="0">
										<xsd:simpleType>
											<xsd:restriction base="xsd:double">
												<xsd:minInclusive value="-100000"/>
												<xsd:maxExclusive value="100000"/>
											</xsd:restriction>
										</xsd:simpleType>
									</xsd:attribute>
								</xsd:restriction>
							</xsd:simpleContent>
						</xsd:complexType>
					</xsd:element>



2) How to simulate a c/c++ enum in schema.

I would like the named constants to be A,B,C.

My attempt obviously fails:

<simpleType name="some">
 <restriction base="xsd:short"> <!-- ofcourse
xsd:string will work -->
   <enumeration value="A"/>
   <enumeration value="B"/>
   <enumeration value="C"/>
 </restriction>
</simpleType>


3)Is it possible to declare an attribute in an
abstract base class that will
be
fixed in the derived schema (so, it doen't need to
appear in the xml
instance)?

Thanks for any info/pointers.

Example:
 <complexType name="baseType"
    <attribute name="that" type="someenum"/>
 >

<complexType name="derivedType">
  <complexContent>
    <extension base="baseType">
      <attribute name="that" type="someenum"
fixed="specficenum"/>
    </extension>
  </complexContent>
</complexType>



Thanks for any hints/tips/pointers



=====


__________________________________________________
Do You Yahoo!?
Buy the perfect holiday gifts at Yahoo! Shopping.
http://shopping.yahoo.com
Received on Thursday, 6 December 2001 19:29:43 GMT

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