From: Stefan B. <bo...@ap...> - 2010-03-22 12:43:50
|
On 2010-03-22, James Sewell <Jam...@ar...> wrote: > From looking at JAXP 1.3 I still can't see a way of defining an > absolute URI to use when working with relative schema locations > (unless this is what a ResourceResolver is for??) Honestly I'm not sure whether ResourceResolver would be used for schemaLocation hints since the docs (for SchemaFactory#setResourceResolver) only talk about import and include. It may be worth a try, but I'm afraid XMLUnit currently wouldn't give you the access you'd need. > As mentioned all my schema location information is included by way of > xsi:SchemaLocation elements, but as they are relative (to the original > XML document location) I need to be able to define a URI to use as a > base. If you are specifiying your input (the XML document) as a Source instance it may be sufficient if this Source has the correct system ID. I know you've tried that for the SAX InputSource used in the "old" validation API, maybe JAXP13's take will yield better results. > I could grab the elements from the XML document and use these schemas > with addSchemaSource, but it seems like this should be unnecessary? I agree there should be a better way. Unfortunately I haven't played with that part of JAXP too much, so I can't help much more than ask you to try out things. Stefan |