From: Stefan B. <bo...@ap...> - 2007-04-24 04:33:42
|
On Mon, 23 Apr 2007, David Carver <dc...@st...> wrote: >> Note that I don't like the XMLUnit with lots of statics API myself >> either. I opted for API consistency when I added new things for >> the 1.1 release, but I plan to experiment with a different approach >> for XMLUnit 2.0. Your input is and will be more than welcome. > > Well, it seems that if you use the XMLUnit.setNamespaceContext, it > will carry across when it gets the XPath engine. It is supposed to 8-) > I haven't taken a look yet, but is there a way to specify which > XPath engine to use, as we can with the SAX and DOM parsers? No. XMLUnit will pick whatever XPathFactory returns and fall back to SimpleXpathEngine pre-JAXP-1.3. I don't think there is a system property to choose a factory or is there? > It would be nice to be able to specify either JAXEN, XALAN, or > SAXON's xpath engines. Particularly if you are trying to verify > that something works across the various XPath engines available. I see. The primary use case is that you want to verify a piece of XML by testing the results of some given XPath expressions. What you describe is testing an XPath expression by applying it to a given document. So in your case the expression and not the document would be under test, right? I can see how being able to pick a XPath implementation might be useful here, agreed. I'll look into it. > Also, there was mention of schema validation. Is this just > validating an xml instance, or is this validating the xml schema it > self? Validating the instance, though I must admit that I'm not sure what you mean by validating the Schema itself. <http://xmlunit.sourceforge.net/userguide/html/ar01s04.html#XML%20Schema%20Validation> Stefan |