Yes, there actually is a theoretically better way. The only problem is that it did not work for me when I tried it before, and I do not like recommending methods that I have not had success with.
Since schemas are, in and of themselves, XML instance documents, you can actually validate them with Xerces against the "schema for schemas." Note that YMMV, and W3C said that it is accurate but not normative, so the specification is still the official reference: http://www.w3.org/2001/XMLSchema.xsd I hope that it works better for you than it did for me. As before, the validator I hacked together should take care of this if you can get that schema file working. Now, about that second issue with my assumptions about character encoding. I realize that this is a bug, which I prominently advertised in my list e-mail of the initial release. The reason that it is the way it is is, (lol, that's a good clause right there), at my workplace we only use XML for business integration data encoded with either ASCII or UTF8 element names and namespace URIs. Personally I believe at least 90% of XML documents comply with this limit but of course that's just a guess. When I have time, I will fix the problem. It's just not a high priority issue where I think it would be fair to charge my employer for my development time, so it must wait until after this summer because I am really too busy to take it on at the moment. In the mean time, I hope that it's useful for people who just want to do some quick hacking, or get really fast performance on simple, common, everyday XML data like what you will find 90% of the time. HTH! Matt -----Original Message----- From: Elisha Berns [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 24, 2005 10:45 AM To: [email protected] Subject: RE: Validating XSD(s) Matt, My question is what's the way to validate JUST an XSD schema file, not how to validate an XML file that has a schema. For the latter case your example is helpful; however, the need I have is to validate only the XSD file. Your method would imply that one needs to create a dummy XML file as a holder so that you can validate the XSD. There must be a better way. On another note, in your example I think your method of finding the schemaLocation attribute needs to be corrected because it makes to many assumptions about the character encoding (8 bit). I believe a better way to get the information is to use the Progressive Parse interface of the SAX2XMLReader class which will work with any XML character encoding that Xerces accepts. Elisha ___________________________________________________________________ The information contained in this message and any attachment may be proprietary, confidential, and privileged or subject to the work product doctrine and thus protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify me immediately by replying to this message and deleting it and all copies and backups thereof. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
