You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by ds...@mmm.com on 2001/05/23 17:17:19 UTC

Problem Parsing with Xerces-J 1.4.0

I just installed the 1.4 packages and now when I try and read in an XML doc
and parse it with a schema I get the following errors (btw I turned on the
DEBUG_SCHEMA_VALIDATION)

=======StartElement : personnel
deal with XSI
before find XSI: xmlns,null
deal with XSI
before find XSI: xsi,null
[Error] person-schema3.xml:3:149: Element type "personnel" must be
declared.

It looks like it didn't read in my xsd document...Here is the top part of
the document (btw it's the one downloaded from the apache site...)  Here is
the code...I'm using the domParser from the examples...
{
DOMParser myparser = new DOMParser();
          myparser.setFeature
("http://apache.org/xml/features/validation/schema",true);
          myparser.setFeature
("http://xml.org/sax/features/namespaces",true);
          Document doc2 = myparser.parse
("file:///D:/MES_WebSite/development/xmldoc/person-schema3.xml");
}

<?xml version="1.0" encoding="UTF-8" ?>
 <personnel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="../schema/personal3.xsd">
 <person id="Big.Boss">
 <name>
  <family>Boss</family>
  <given>Big</given>
  </name>
  <email>chief@foo.com</email>
  <link subordinates="one.worker two.worker three.worker four.worker
five.worker" />
  </person>
 <person id="one.worker">
 <name>

and a snippet from the schema...
<?xml version="1.0" encoding="UTF-8" ?>
 <schema xmlns="http://www.w3.org/2001/XMLSchema">
 <element name="personnel">
 <complexType>
 <sequence>
  <element ref="person" minOccurs="1" maxOccurs="unbounded" />
  </sequence>
  </complexType>
 <unique name="unique1">
  <selector xpath="person" />
  <field xpath="@name" />
  </unique>

Any help for this newbie would be greatly appreciated...

thanks
Doug