Thanks for the quick reply Stefan!


>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??)



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.



I could grab the elements from the XML document and use these schemas with 
addSchemaSource, but it seems like this should be unnecessary? As I said if I 
change my xsi:schemaLocation xsd URI from relative to absolute it all works 
fine, but I don't have this luxury in the real world.



Hope that makes sense!



Cheers,

James





Hi James,



On 2010-03-19, James Sewell <James.Sewell-Oxwxy+7+MgL0CCvOHzKKcA< at 
>public.gmane.org<http://public.gmane.org>> wrote:





You may consider using the JAXP 1.3 validator instead when you do schema

validation (if your Java class library supports JAXP 1.3, that is), see

<http://xmlunit.sourceforge.net/userguide/html/ar01s04.html#JAXP%201.3%20Validation>.

Using this you have more control over your schema locations.







system ID really is something from the DTD part of XML's heritage, you

could explicitly specify this using one of the alternative constructors

of Validator.  It doesn't help, though, since the system ID is not what

the XML parser is going to use for schema locations.



If you want or must stick to the older API, the Validator's

setJAXP12SchemaSource() is what you are looking for, see

<http://xmlunit.sourceforge.net/userguide/html/ar01s04.html#XML%20Schema%20Validation>



Cheers



        Stefan



------------------------------------------------------------------------------

Download Intel&#174; Parallel Studio Eval

Try the new software tools for yourself. Speed compiling, find bugs

proactively, and fine-tune applications for parallel performance.

See why Intel Parallel Studio got high marks during beta.

http://p.sf.net/sfu/intel-sw-dev

________________________________
The contents of this email are confidential and may be subject to legal or 
professional privilege and copyright. No representation is made that this email 
is free of viruses or other defects. If you have received this communication in 
error, you may not copy or distribute any part of it or otherwise disclose its 
contents to anyone. Please advise the sender of your incorrect receipt of this 
correspondence.
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Xmlunit-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xmlunit-general

Reply via email to