Neil, Thanks for the response. I guess to some extent the problem is one needs to be solved within the standard JAXP specification, possibly by deprecating setValidating and defining setDTDValidating and setXSDValidating methods instead?
Simon -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, 16 April 2002 10:31 a.m. To: [EMAIL PROTECTED] Subject: Re: Validating XML documents using the Xerces parser Hi Simon, The deal is this: the SAX validation feature was developed in the days of DTD's. When you turned it on, it meant "report validation errors" so for a document with no DTD--which, by the XML 1.0 spec is invalid--we'd have to report errors. i.e., on a schema-valid document we'd have to report errors if it didn't also refer to a DTD and conform to it (which schema instance documents naturally don't tend to do). In order to make us do schema-validation, you've got to switch the validation/schema feature on. This shuts the DTD validator up, as it were, so that the only errors we report are schema errors. Now what does it mean to have SAX's validation feature turned off but schema validation turned on? That's a good question; we're still mulling over the possibilities on that front... HTH, Neil Neil Graham XML Parser Development IBM Toronto Lab Phone: 905-413-3519, T/L 969-3519 E-mail: [EMAIL PROTECTED] "Dallaway, Simon" <[EMAIL PROTECTED] To: nisys.com> "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> 04/14/2002 09:39 PM cc: Please respond to Subject: Validating XML documents xerces-j-user using the Xerces parser I'm a little confused. I've figured out that in order to make the parser pick up and use an XSD specified by an xsi:schemaLocation attribute I need to set the Apache attribute shown in the code fragment below. factory.setNamespaceAware(true); factory.setValidating(true); factory.setAttribute ( "http://apache.org/xml/features/validation/schema", new Boolean (true)); I would have thought that setting both setNamespaceAware & setValidating to true should be sufficient to achieve this. What am I missing? regards, OSD Systems Architect Communications Solutions Program Unisys Ph: 64-4-462 2256 Fax: 64-4-462 2135 Email: [EMAIL PROTECTED] CAUTION: This e-mail message and accompanying data may contain information that is confidential. If you are not the intended recipient you are notified that all content is to be treated as confidential unless otherwise specified, and is not to be used, copied or forwarded to third parties without the prior permission of the author. If you have received this e-mail message in error please delete it and notify me. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
