Post a Job  |   Ask a Question?   |   Already registered? login or register
AUROVINDO SAHU
16/11/2015 10:59 PM

xsd


<price currency="US/IND">restriction</price> restriction is the price should not be negative and the attribute should contain enumeration. how can i do this in XSD can any one tell ?
Spam    2 Comments

sriman,student
18/11/2015 10:27:03
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="book" type="bookType"/> <xs:complexType name="bookType"> <xs:sequence> <xs:element name="isbnNo" type="xs:string"/> <xs:element name="price" type="priceType1"/> </xs:sequence> </xs:complexType> <xs:simpleType name="priceType"> <xs:restriction base="xs:float"> <xs:minInclusive value="0.1"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="cType"> <xs:restriction base="xs:string"> <xs:enumeration value="US"/> <xs:enumeration value="IND"/> </xs:restriction> </xs:simpleType> <xs:complexType name="priceType1"> <xs:simpleContent> <xs:extension base="priceType"> <xs:attribute name="currency" type="cType" use="required"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:schema>

sriman,student
18/11/2015 10:27:42
may this is match to ur requirement.

Languages :
xml