1

I'm using xerces c++ 3.2.0 to validate XML against XSD 1.1

According to its docs, xerces uses a subset of XPath 2.0 instead of full XPath checking, so I need to "enable a certain xerces feature"

This feature:

http://apache.org/xml/features/validation/cta-full-xpath-checking

Which I couldn't find it in XMLUni so I created it myself:

parser = XMLReaderFactory::createXMLReader();
parser->setFeature(L"http://apache.org/xml/features/validation/cta-full-xpath-checking", true);

Now when I run my code it crashes:

Unhandled exception at 0xXXXXXXXX in XXXXXX.exe: Microsoft C++ exception: xercesc_3_2::SAXNotRecognizedException at memory location 0xXXXXXXXX.

It gets the same result as if I run:

parser = XMLReaderFactory::createXMLReader();
parser->setFeature(L"banana gun!", true);

If I comment out the last line, it will work but does not use full XPath checking (i.e. no Assertion)

What am I missing here?


Note that if I set other features (like schema-full-checking) this way

parser = XMLReaderFactory::createXMLReader();
parser->setFeature(L"http://apache.org/xml/features/validation/schema-full-checking", true);

it works, the same result as:

parser = XMLReaderFactory::createXMLReader();
parser->setFeature(XMLUni::fgXercesSchemaFullChecking, true);

but not with cta-full-xpath-checking feature. why?

Bizhan
  • 16,157
  • 9
  • 63
  • 101

0 Answers0