Hi Jorge,
   Kindly read few answers below please,

On Sat, Feb 11, 2012 at 11:01 PM, Jorge Williams
<jorge.willi...@rackspace.com> wrote:
> If I do:
>
> java -cp $CLASSPATH jaxp.SourceValidator  -fx -xsd11 -a simple.xsd -i
> simple.xml
>
> things validate correctly.  However if I enable assertion checks
>
> java -ea -cp $CLASSPATH jaxp.SourceValidator  -fx -xsd11 -a simple.xsd -i
> simple.xml
>
> I get the following:
>
> Exception in thread "main" java.lang.AssertionError
>         at
> org.eclipse.wst.xml.xpath2.processor.internal.types.QName.namespace(QName.java:236)

If we enabled "JDK language assertions" (not XSD 1.1 assertions!),
then Xerces's XPath 2.0 engine might result in inconsistent evaluation
results in certain cases -- as you've provided one of the evidences.
This is due to the fact that, the original authors of PsychoPath XPath
2.0 engine (which is used by Xerces), have used the "JDK assertions"
idiom much within their product. We (i.e Xerces team) after inheriting
the original XPath 2.0 code base from the original PsychoPath engine
contributors haven't touched much the "JDK assertions" parts of the
PsychoPath XPath 2.0 engine -- and this manifests in JDK errors in
certain cases, as per also your evidence.

It is adviced, that Xerces XSD 1.1 CTA implementation when working
with full XPath 2.0 mode or using <assert>/<assertion>, must not use
"JDK assertions" enabled.

> The other error deals when handling xs:ID attributes, when you ask the
> source validator to run the query multiple times:
>
> java -cp $CLASSPATH jaxp.SourceValidator  -x 2 -fx -xsd11 -a simple.xsd -i
> simple.xml
>
> I get the following:
>
> [Error] simple.xml:2:46: cvc-id.2: There are multiple occurrences of ID
> value 'id29299'.
> [Error] simple.xml:2:46: cvc-attribute.3: The value 'id29299' of attribute
> 'id' on element 'simple' is not valid with respect to its type, 'ID'.
> [Error] simple.xml:3:45: cvc-id.2: There are multiple occurrences of ID
> value 'id29300'.
> [Error] simple.xml:3:45: cvc-attribute.3: The value 'id29300' of attribute
> 'id' on element 'simple' is not valid with respect to its type, 'ID'.
> simple.xml: 115/2=57.5 ms

I feel, this may be a bug with jaxp.SourceValidator sample, since it
isn't evaluating this validation episode correctly when iterative
execution is asked for (but for singleton execution, I can see that
result of XSD validation in this case is correct). But we need to
investigate this issue further, to conclude that what is exactly
wrong.




-- 
Regards,
Mukul Gandhi

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org
For additional commands, e-mail: j-users-h...@xerces.apache.org

Reply via email to