Hi There!!
Please find the XSD below. I have validated the schema from the mentioned website.Also, have made sure comments are mandatory ,element publisher is xsd:string and element price is xsd:float.
book.xsd:
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="bib">
<xs:complexType mixed="true">
<xs:sequence>
<xs:element type="xs:string" name="comment"
minOccurs="1"/>
<xs:element name="book" maxOccurs="unbounded"
minOccurs="0">
<xs:complexType mixed="true">
<xs:sequence>
<xs:element type="xs:string" name="title"/>
<xs:element name="author" maxOccurs="unbounded"
minOccurs="0">
<xs:complexType mixed="true">
<xs:sequence>
<xs:element type="xs:string" name="last"/>
<xs:element type="xs:string" name="middle"
minOccurs="0"/>
<xs:element type="xs:string" name="first"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element type="xs:string"
name="publisher"/>
<xs:element name="price">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:float">
<xs:attribute type="xs:string" name="discount"
use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:short" name="year"
use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Thanks!!Cheers!!Happy Chegging!!
1. Write an XML Schema for the following XML file satisfying the following requirements: a) comment...
I need help with this xml!
1. Write an XML Schema for the following XML file and validate the xml file against your XML Schema using the online validator: http://tools.decisionsoft.com/schema Validatel. <?xml version="1.0" KEmployees> ?> <Employee KSSN> 737333999</SSN> Name>Christo Dichev</Name> <DateofBirth>1950-03 03</DateOfBirth> <EmployeeType> FULLTIME</ Employee ype> <Salary>7000</Salary> </Employee> Employee> KSSN> 737333333</SSN> <Name> Paul Fisher</Name> <DateOfBirth>1960-01- 01</DateOfBirth> <EmployeeType> FULLTIME</EmployeeT ype> <Salary> 6000</Salary> </Employee> </Employees>
Q.4. Considering the XML Schema shown below, answer the following questions: a) Write an XML document that conforms to the rules of the xml schema given below. Add atleast two book elements. b) Modify the XML schema to add an attribute “id” to the book element which is of the type string and is a mandatory. c) In the XML schema, change the definition of the element “price” such that value of price cannot be lower than 10...