The relevant part of the code is this:
The first validate works as expected. The second validate throws the exception:
net.sf.saxon.trans.XPathException: Cannot use schema-validated input documents when the query/stylesheet is not schema-aware
Caused by: net.sf.saxon.trans.XPathException: Cannot use schema-validated input documents when the query/stylesheet is not schema-aware
... 2 more
BTW, would be nice if we could pool Validators and ValidatorHandlers. Xerces performs significantly faster when these resources are pooled, so I've gotten into the habit of pooling them. The fact that Saxon doesn't support pooling (I've had issues pooling
ValidatorHandlers as well) means I have to treat Saxon as an edge case -- not that big of a deal -- but would be nice if Saxon could work as a drop in replacement for Xerces with minimal code changes.
On Jun 25, 2012, at 4:09 AM, Michael Kay wrote:
>> I haven't seen that error before, but it looks like you are passing
> the validated input to a non-schema-aware transform or xquery.
> That's what the code thinks when it produces this message, but I think
> from the evidence that it's wrong. Somehow it has been misled into
> thinking that the validation is invoked during query or XSLT processing
> when that isn't the case. I haven't been able to determine what
> conditions cause this.
> Michael Kay
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> saxon-help mailing list archived at