Hi
I am trying to put value restrictions on certain elements in an xml file
using a schema file.
The syntax in my schema file looks like the following
<xs:element name="AXYZMachines" msdata:IsDataSet="true"
msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="MotionParameters">
<xs:complexType>
<xs:sequence>
<xs:element name="FeedRateMAX" type="xs:double">
<xs:restriction base="xs:double">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="1000"/>
</xs:restriction>
</xs:element>
<xs:element name="PlungeRateMAX" type="xs:string"
minOccurs="0" />
<xs:element name="TravelRateMAX" type="xs:string"
minOccurs="0" />
<xs:element name="TravelRate" type="xs:string" minOccurs="0" />
<xs:element name="PlungeRate" type="xs:string" minOccurs="0" />
<xs:element name="FeedRate" type="xs:string" minOccurs="0" />
<xs:element name="JogSpeedMode" type="xs:string" minOccurs="0"
/>
<xs:element name="SeekXYSpeed" type="xs:string" minOccurs="0" />
<xs:element name="SeekZSpeed" type="xs:string" minOccurs="0" />
<xs:element name="JerkGrate" type="xs:string" minOccurs="0" />
<xs:element name="AccelerationG" type="xs:string"
minOccurs="0" />
<xs:element name="AccelMAX" type="xs:string" minOccurs="0" />
<xs:element name="JerkMAX" type="xs:string" minOccurs="0" />
<xs:element name="CentripetalG" type="xs:string" minOccurs="0"
/>
<xs:element name="BrakeG" type="xs:string" minOccurs="0" />
<xs:element name="ArcError" type="xs:string" minOccurs="0" />
<xs:element name="MinLength" type="xs:string" minOccurs="0" />
<xs:element name="CornerPause" type="xs:string" minOccurs="0" />
<xs:element name="StartPause" type="xs:string" minOccurs="0" />
<xs:element name="JerkFactor" type="xs:string" minOccurs="0" />
<xs:element name="CentripetalAcceleration" type="xs:string"
minOccurs="0" />
<xs:element name="LinearAcceleration" type="xs:string"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
I also have the following C# code that reads the schema in
dsMachineParameters = new DataSet("MachineParameters");
dsMachineParameters.ReadXmlSchema("SchemaA.xsd");
I get the following exception from my C# code:
The 'http/://www.w3.org/2001/XMLSchema:restriction' element is not supported
in this context. How can I add restrictions ranges on values?
--
Don