santoo 0 Newbie Poster

Hi,

this is my xml fragment

<?xml version="1.0" encoding="ISO-8859-1"?>

<Table xmlns="urn:UMS-application" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance/UMS_APP.xsd">
<Row>
<APP_ID>skumar</APP_ID>
<APP_NAME>1</APP_NAME>
<APP_DESC>Sample test application 2</APP_DESC>
<ACTIVE>true</ACTIVE>
</Row>
<Row>
<APP_ID>10</APP_ID>
<APP_NAME>Test3</APP_NAME>
<APP_DESC>sample test</APP_DESC>
<ACTIVE>true</ACTIVE>
</Row>
<Row>
<APP_ID>11</APP_ID>
<APP_NAME>Test4</APP_NAME>
<ACTIVE>true</ACTIVE>
</Row>
</Table>

this is the xsd schema file for validating the above xml

<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="UMS_APPS"
targetNamespace="urn:UMS-application"
xmlns="urn:UMS-application" elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Table">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="Row">
<xs:complexType>
<xs:sequence>
<xs:element name="APP_ID" type="xs:positiveinteger"/>
<xs:element name="APP_NAME" type="xs:string" />
<xs:element minOccurs="0" name="APP_DESC" type="xs:string" default="" />
<xs:element name="ACTIVE" type="xs:boolean" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

when I validate the xml using the xsd it is saying validation success.

when I chenge the appid in xml to a string ,or appname to a integer value..still it running with out any errors.wher appid is of type integer and appname is of type string.plzz tell me whether there is any mistake in xsd file.

thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.