Hi,
I have been trying to utilize the new properties in Xerces 1.4.1 and have
run into a couple of problems:
XMLParser.java should be updated so that the function getProperty will
return the value that has been specified for the newly recognized properties
for schema validation. Currently it is commented out as follows :
//
// Xerces Properties
//
/*
else if (propertyId.startsWith(XERCES_PROPERTIES_PREFIX)) {
//
// No properties defined yet that are common to all parsers.
//
}
*/
Apart from this error, I have also not been able to get the properties to
work in the 1.4.1 build (binary). I followed the sample that was posted
here but it doesn't seem to work. I scanned the source and it seems right--
so I tried to make the jar from the source but my 'make' seems to be the
wrong version...
// Turn the validation feature on
parser.setFeature( "http://xml.org/sax/features/validation", true);
// If there is an external schema set it
if (schema != null) {
parser.setProperty("http://apache.org/xml/properties/schema/external-noNames
paceSchemaLocation", schema);
}
// Parse and validate
System.out.println("Validating source document...");
parser.parse(instance);
My source document has no xsi: attributes in it. When parsing I get the
classic errors that saying none of my elements have been declared which
leads me to believe it couldn't find the schema. However I tried commenting
this line out and just setting the value within the instance document and it
worked perfectly.
I am wildly excited about this feature-- it couldn't have come at a better
time!
Thanks,
Jeff Rafter
Defined Systems
http://www.defined.net
XML Development and Developer Web Hosting
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]