xerces-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mukul Gandhi <muk...@apache.org>
Subject Re: Xerces-J 2.12.0 vs. Saxon: XSD 1.1 CTA validation errors
Date Thu, 02 Aug 2018 06:59:03 GMT
Hi Yitzhak,
   It would be ok, if you don't direct the question only to me. Please do
write to the list. This way, other list members could also reply to the

Anyway, I've analyzed about your doubts and below are my thoughts.

On Thu, Aug 2, 2018 at 12:14 AM, Yitzhak Khabinsky <
Yitzhak.Khabinsky@millicom.com> wrote:
>    - I added the *-fx* parameter (to turn on full XPath 2.0 checks with
>    CTA when working with XSD 1.1), but it didn’t help.
> The -fx option in the sample jaxp.SourceValidator works correctly. If
enabled, it will cause full XPath 2.0 language to be available in the CTA
XPath expressions.

>    - The CTA expression doesn’t accept “eq” instead of “=”:
>    <xs:alternative test="@OrganizationCode eq '3TZ005'" type=
>    "AccountCode-TZ-Zantel"/>
> I don't think, there's an issue with the XPath 2.0 "eq" operator
implementation in Xerces. I hope you know following,
"eq" does value comparison. i.e it is used for comparing single values. For
e.g, 1 eq 1 would return true, and 1 eq 2 would return false.
"=" is a general comparison operator (it can accept sequences as arguments).
For e.g, 1 = (1,2) would return true. 1 eq (1,2) would result in a run-time

> It seems that the *base-uri(.)* function call is failing to return the
fully qualified path to the XML file that is being validated.

I don't think, this is a Xerces bug. If you write base-uri(node-ref) in an
xs:assert XPath expression, with Xerces you would get a zero length string
as result. When evaluating xs:assert with Xerces, an in-memory DOM tree is
constructed before passing that DOM to the XPath 2.0 processor. We don't
set the base-uri on any of the nodes in this DOM. It can be little
debatable, whether this is correct or not. My personal opinion is, that
this is compliant.

If we look at our XPath 2.0 processor as stand-alone library,
base-uri(node-ref) is computed correctly. For e.g, with the URL
http://www.w3schools.com/xml/note.xml, evaluating 'string(base-uri(note))'
returns "http://www.w3schools.com/xml/note.xml".

For the future, requesting you to please provide a minimal XML and XSD
sample that is focused only on the actual issue. That makes it easier to
debug on our side.

Mukul Gandhi

View raw message