Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML with Schema

Status
Not open for further replies.

varavoorvishnu

Programmer
Sep 9, 2002
45
Hi,
I hv a problem in testing a sample Schema with XML.
My sample XML is as follows:
InputFile.xml
---------------
<?xml version="1.0" ?>
<Request xmlns:xsi=" xsi:schemaLocation="'Employee.xsd">
<sqlaction value="insert">
<EmpDetails>
<Empid>10</Empid>
</sqlaction>
</Request>

and My Schema file Employee.xsd reads as follows:
Employee.xsd
--------------
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="<xs:element name="EmpDetails">

<xs:complexType>
<xs:sequence>
<!-- Employee ID -->
<xs:element name="Empid" type="integer"> </xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>


Now in the InputFile.xml if I give some character value for the element "Empid",the xml file is supposed to throw an error which doesnt take place.It just refreshes as it is.Please help with some other alternative or correction if required.


Regards,
Vishnu
:)
 
You'd probably be better off posting this in forum426 .

However, you should be aware that many applications will accept any XML documents that are well-formed, and not validate them against a schema unless you explicitly ask them to. Some applications can not be made to validate at all (I don't think IE can, for example).

-- Chris Hunt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top