Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Aruna

  • Rank
  1. Can you try this. I have placed the attribute "id" inside the xs:complexType/xs:sequence. What is the error message you got? <xs:element name="product"> <xs:complexType> <xs:sequence> <xs:attribute name="id" type="xs:integer" /> <xs:element name="title" type="xs:string" /> <xs:element name="stock" /> <xs:complexType> <xs:sequence> <xs:element name="available" type="xs:integer" /&
  2. Hey its not hard. It is very easy. If you try this code it will not allow repeating values for Paz: <?xml version="1.0" encoding="UTF-8"?><xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="StatussR"> <xs:complexType> <xs:sequence> <xs:element name="Paz" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <xs:key name="keyPAZ"> <xs:selector xpath="StatussR"/> <xs:field xpath="Paz"/> </xs:key> </xs:element><
  3. We can validate against empty elements in XML as follows. In the element tag recentForms in XML file give nillable="true"In the schema file in the corresponding element tag give xsi:nil="true"
  4. We have a keyword called xs:key in XML Schema to define unique elements that are not null. This will ensure that values are not repeated and that they are unique. To use xs:key we need to understand xs:selector and xs:field.If you would like to define a unique element that can be null it could be done using xs:unique keyword.For knowing more please refer to my article at http://technologyandleadership.com/xml-sch...y-and-xskeyref/
  5. In complex type elements what is the purpose of mixed attribute?<xs:element name="letter" type="lettertype"/><xs:complexType name="lettertype" mixed="true"> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="orderid" type="xs:positiveInteger"/> <xs:element name="shipdate" type="xs:date"/> </xs:sequence></xs:complexType>Does the mixed attribute specify that any datatype can be used. Here i can see that the datatype of name is hardcoded as string and that of orderid is hardcoded as positiveInteger. What's the purp
  6. Hi,To check if there is empty tag in the xml file, we need to write code both in the xml file and the xsd:How to have an empty tag validated successfully against schema?1. In xsd file add this:<xs:element name="rdfs:comment" type="xs:string" nillable="false"/>2. In xml file add this:<rdfs:comment xsi:nil="false"/>Here the new keywords to be used to validate aganist an empty tag are nillable and xsi:nilRegards,Arunahttp://technologyandleadership.com/technology/
  • Create New...