View Single Post
Old 08-10-2009, 07:55 PM   PM User | #1
renting
New to the CF scene

 
Join Date: Aug 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
renting is an unknown quantity at this point
setting attribute in complextype restriction

I have the following code:

Code:
	<xs:complexType name="Frequency">
		<xs:simpleContent>
			<xs:extension base="xs:double">
				<xs:attribute name="units" use="required">
					<xs:simpleType>
						<xs:restriction base="xs:string">
							<xs:enumeration value="Hz"/>
							<xs:enumeration value="KHz"/>
							<xs:enumeration value="MHz"/>
							<xs:enumeration value="GHz"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:attribute>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
Code:
<xs:complexType name="ClockType">
		<xs:simpleContent>
			<xs:restriction base="Frequency">
				<xs:enumeration value="160"/>
				<xs:enumeration value="200"/>
			</xs:restriction>
		</xs:simpleContent>
	</xs:complexType>
My problem is, that for the life of me, I can't figure out how to set the units attribute when restricting Frequency in ClockType. What I want to do is have ClockType be either 160MHz or 200MHz.

Does anyone have a clue how to do this?

Thank you for any replies.
renting is offline   Reply With Quote