xsd attached.
 
 
Peter A. Volchek
Software Engineer
Metis International, Inc.
[EMAIL PROTECTED]
----- Original Message -----
Sent: Thursday, October 25, 2001 17:36
Subject: Problem is parsing a schema.

Hi,

I am facing a problem in validating a xml with schema. I need to write schema which supports attributes for leaf elements. Attached is the sample I tried and the parser Xerces-c 1.5.1 gives the following error.

Error at file "D:\Buysell.xml", line 4, column 135
   Message: The type 'xs:string' is a simple type. It cannot be used in a derivation by RESTRICTION for a complexType

Can somebody tell me what is wrong with the schema and how can I fix it with the requirement described above. Please help out.

Regards,

Abhay.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";>

     <xs:simpleType name="values">
       <xs:restriction base="xs:string">
   	     <xs:enumeration value="BUY"/>
   		 <xs:enumeration value="SELL"/>
       </xs:restriction>
     </xs:simpleType>


	
	<xs:element name="BuySellInd">
		<xs:complexType>
			<xs:simpleContent>
				<xs:extension base="values">
                    <xs:attribute name="elementID" type="xs:string"/>
				</xs:extension>                
			</xs:simpleContent>			
		</xs:complexType>
	</xs:element>
</xs:schema>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to