I'm sure this question has a really trivial answer, but
I just can't seem to find it anywhere in the Apache docs.
I have a Xerces-based reader for an XML file format that
currently uses a DTD, and it works.  But when I try
to use an XSD instead, I get
 Fatal Error at file /foo/foo.xsd, line 2, char 3
  Message: Expected a markup declaration

Here are the first two lines of foo.xsd:
  <?xml version="1.0" encoding="UTF-8"?>
  <xs:schema

I thought it might be a matter of setting the right
features in the DOMBuilder object, but I've turned
on all the ones I can find that relate to XSDs (except
the ones that cause tighter checking of XSDs, which
I turned off), and it still doesn't work.  Here are
my feature-setting calls:
  _builder->setFeature(XMLUni::fgDOMNamespaces, true);
  _builder->setFeature(XMLUni::fgDOMNamespaceDeclarations,true);
  _builder->setFeature(XMLUni::fgXercesSchema, true);
  _builder->setFeature(XMLUni::fgXercesSchemaFullChecking, false);
  _builder->setFeature(XMLUni::fgDOMValidation, true);
  _builder->setFeature(XMLUni::fgDOMDatatypeNormalization, true);

Any ideas?


Reply via email to