Hello Xerces World, I've been using xerces for years to do simple XML parsing and it's wonderful. I recently started using it to build in-memory DOMs and serialize them out as well... everything has been great. I'm now starting to use XML schemas, and well, things stopped being really easy. :)
Scouring the internet has made me feel like I'm not the only one who has had some trouble dealing with schemas. I tried trolling this mailing list's archives, but they're down for some reason (or the xml.apache.org website is incorrect). I have several schema related questions. I'm using Xerces 2.4.0 under both Windows Xp and Red Hat Linux. 1) I've written a java application that uses XML as a load/save format. To do this, I create a DOM in memory, and write it out. No problems doing this, it's been working great. Now, what I'd like to do is specify what schema it's supposed to adhere to. Basically, I want to get this line to happen: <manufacturer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.some.biz/schemas/manufacturer.xsd"> Instead of this: <manufacturer> What API call(s) need(s) to be made to make this happen, and at what point in the process of building the Document should I associate it with the schema? 2) I read the Xerces FAQ, and I found out that you have a few hoops to jump through to be able to do in-memory validation of a DOM Document against a schema (Document.normalizeDocument()). I built my new dom3-xerces jars, did everything the FAQ mentioned, but every time I execute my test app, as older version of xerces is found. Presumably, this is because Java 1.4 comes with its own. I read how you can override the JRE defaults by setting some application properties or somesuch. I stopped there. I'm wondering what kind of experience people have had performing this override, and if it messes things up with other java apps? We use Eclipse, JBoss, Tomcat, and a handful of other tools as well. 3) How else can I store schemas, other than placing schemas on a public web site to be accessed by all? I'd like to explore the option of keeping them locally stored, without hard-coding a complete path to the schema. Given: <manufacturer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="manufacturer.xsd"> Is there a way to tell xerces where you keep your schemas so it can find them, and not just look in the default location? I'd like to have a schemas directory as part of my application distribution. Thanks in advance, and I apologize if these are common questions or out of the scope of this mailing list. Regards, Christian --------------------------------------------------------------------------- Christian 'xian' Nelson [EMAIL PROTECTED] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "Don't ask yourself what the world needs. Ask yourself what makes you come alive, and go do that, because what the world needs is people who have come alive." -- Howard Thurman --------------------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]