I noticed that if the system property
com.bluecast.xml.ValidatingSAXParserFactory is not set,
Piccolo will try to search the class path for all
implementors of SAXParserFactory using the services
mechanism as used by SAXParserFactory itself.
Despite having Xerces on the classpath, it wasn't being
picked up. Having investigated, it appears there's a
bug in the JAXPSAXParserFactory and
The method FactoryServiceFinder.findService(String)
correctly added the "META-INF/services" prefix to the
name of the interface before searching for it, but the
method FactoryServiceFinder.findServices(String) (which
looks for *all* implementing classes) did not. This
means it was always returning an empty enumeration.
Changing line 53 from:
Solves the first bit of the problem.
I also added the character set used to read the file to
UTF-8 to match up with findService().
The second problem was that the
JAXPSAXParserFactory.findValidatingFactory() method was
comparing the name of the class with
"com.bluecast.xml.Piccolo" rather than the name of its
own SAXParserFactory implementation.