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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validatating xml with an schema using Dom Parser

Status
Not open for further replies.

softjack

Programmer
Dec 4, 2005
44
IN
Hi
Im trying to validate my xml with an schema using DOM Parser and xerces2.8.

While setting the feature with a DOMParser object i get a SAXNotRecognized Exception.The line where im getting error is shown below.
Code:
parser.setFeature("[URL unfurl="true"]http://apache.org/xml/features/validation/schema-full-checking",false);[/URL]
and in

Code:
parser.setProperty("[URL unfurl="true"]http://apache.org/xml/properties/schema/external-schemaLocation","http://abc.com/4/ProcessPartsPickList.xsd"+""+xsdFile);[/URL]

I tried to comment each and run the code but as soon as it gets any one of these features it gives an error.

Below is the code of the top part of xsd....

Code:
<?xml version="1.0" encoding="utf-8"?>

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="[URL unfurl="true"]http://abc.com/4/ProcessPartsPickList.xsd"[/URL] xmlns="[URL unfurl="true"]http://abc.com/4/ProcessPartsPickList.xsd"[/URL] xmlns:xs="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema">[/URL]

      <xs:element name="ProcessPartsPickList">

            <xs:complexType>

                  <xs:sequence>

                        <xs:element name="ApplicationArea">
...

Please suggest me how shall i mention those in my setFeature()

Thanks in advance
regards,

Softjack
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top