Target NameSpace error while parsing the xml
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   avantika_k
Posted On:   Tuesday, August 5, 2003 10:56 PM

I am parsing an xml file using DocumentBuilder.parse I am validating the xml using an xsd. Getting the following error 2003-08-06 11:06:52,203 DEBUG [ExecuteThread: '11' for queue: 'default'] xmlParser(loadXML:120) - org.xml.sax.SAXParseException: General Schema Error: Schema in d:/xml/deploy/web-inf/myxsd.xsd has a different target namespace from the one specified in the instance document :. The xml & xsd are as shown below <?xml version="1.0" encoding="ISO-8859-1" ?> xsi:noNamespaceSchemaLocation='d:/xml/deploy/web-inf/myxsd.xsd' policytype="deny"   More>>


I am parsing an xml file using DocumentBuilder.parse


I am validating the xml using an xsd.

Getting the following error



2003-08-06 11:06:52,203 DEBUG [ExecuteThread: '11' for queue: 'default'] xmlParser(loadXML:120) -

org.xml.sax.SAXParseException: General Schema Error: Schema
in d:/xml/deploy/web-inf/myxsd.xsd has a
different target namespace from the
one
specified in the instance document :.




The xml & xsd are as shown below



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



xsi:noNamespaceSchemaLocation='d:/xml/deploy/web-inf/myxsd.xsd' policytype="deny">














<?xml version="1.0" encoding="UTF-8"?>



xmlns="http://www.w3.org/2001/XMLSchema"

xmlns:sec="http://localhost:7001/deploy"

targetNamespace="http://localhost:7001/deploy"
elementFormDefault="qualified">









































Can anyone tell me how to proceed?

   <<Less

Re: Target NameSpace error while parsing the xml

Posted By:   Christopher_Koenigsberg  
Posted On:   Wednesday, August 6, 2003 06:23 AM

I could be entirely or mostly wrong, but isn't there a conflict, if your schema explicitly targets the "deploy" namespace with the "sec:" prefix, but your xml document tries to use it as a "noNamespaceSchema"? Doesn't your xml document need to use the same "deploy" namespace, with the same "sec:" prefix, on the schema-defined elements?

About | Sitemap | Contact