xerces-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yitzhak Khabinsky <Yitzhak.Khabin...@Millicom.com>
Subject RE: Xerces-J 2.12.0 vs. Saxon: XSD 1.1 CTA validation errors
Date Thu, 02 Aug 2018 13:27:08 GMT
Hello,

Thanks for your reply.

The minimalistic test case XML/XSD is in the attachment.

Again for comparison, Saxon doesn’t complain about the CTAs and the base-uri() in the XSD.


  1.  The CTA expression continues to trip on search in sequences.
The error message says  “…couldn't compile successfully…”
  2.  The CTA expression doesn’t accept “eq” instead of “=”.
The error message says  “…couldn't compile successfully…”
  3.  It seems that the base-uri(.) function call is failing to return the fully qualified
path to the XML file that is being validated.
     *   Saxon’s base-uri(.) function call correctly emits the following:
file:///d:/Temp/CDW/IFRS/Tanzania/id2938_TZ20171231_IFRS15_CBCInput_3TZ005.xml

Command Line
C:\Program Files\Stylus Studio X16 XML Enterprise Suite 64-bit\bin>"c:\Program Files\Java\jre1.8.0_181\bin\java.exe"
 -Xms512m -Xmx1024m -Xbootclasspath/p:path:;c:\xerces212\xercesImpl.jar;c:\xerces212\xml-apis.jar;c:\xerces212\org.eclipse.wst.xml.xpath2.processor_1.2.0.jar;c:\xerces212\icu4j.jar;c:\xerces212\resolver.jar;c:\xerces212\serializer.jar;c:\xerces212\cupv10k-runtime.jar;c:\xerces212\xercesSamples.jar
jaxp.SourceValidator -xsd11 -fx -i "file:///d:/Temp/CDW/IFRS/Tanzania/XercesJ_TZ20171231_IFRS15_CBCInput_3TZ005.xml"

List of errors
[Error] IFRS15_CBC_In_XercesJ.xsd:26:185: c-cta-xpath: The XPath expression '@OrganizationCode
= ('1GT001', '1GT005', '1GT006', '1GT010', '1HN001', '1HN003', '1SV001', '2BO002', '2PY003',
'2PY007')' couldn't compile successfully in 'cta-subset' mode, during CTA evaluation.
[Error] IFRS15_CBC_In_XercesJ.xsd:27:89: c-cta-xpath: The XPath expression '@OrganizationCode
eq '2CO001'' couldn't compile successfully in 'cta-subset' mode, during CTA evaluation.
[Error] IFRS15_CBC_In_XercesJ.xsd:28:99: c-cta-xpath: The XPath expression '@OrganizationCode
= ('2CO008', '2CO009')' couldn't compile successfully in 'cta-subset' mode, during CTA evaluation.
[Error] IFRS15_CBC_In_XercesJ.xsd:29:113: c-cta-xpath: The XPath expression '@OrganizationCode
= ('3TZ001', '3TZ002', '3TZ003', '3TZ004')' couldn't compile successfully in 'cta-subset'
mode, during CTA evaluation.
[Error] XercesJ_TZ20171231_IFRS15_CBCInput_3TZ005.xml:8:8: cvc-assertion: Assertion evaluation
('ends-with(upper-case(string(base-uri(.))), upper-case(concat('_', @OrganizationCode, '.xml')))')
for element 'root' on schema type '#AnonType_root' did not succeed.

P.S. “…Please do write to the list. This way, other list members could also reply to the
query…”
My initial e-mail has j-users@xerces.apache.org<mailto:j-users@xerces.apache.org> e-mail
as one of the recipients.

Regards,
Yitzhak Khabinsky
Technical Services Lead
Millicom International Services LLC
396 Alhambra Circle, Suite 1100
Coral Gables, FL  33134
Skype4B: +1 (305) 445-4172
Tel: (954) 684-8673
yitzhak.khabinsky@millicom.com<mailto:.khabinsky@millicom.com>
www.millicom.com<https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.millicom.com%2F&data=02%7C01%7CMalcolm.Stewart%40microsoft.com%7C9338023699c2494d08be08d4ad12ce55%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636323743686702678&sdata=DxQ9dfL259rpdVZ9seOAcR6bvgxRobyIerOgvTgPc90%3D&reserved=0>

From: Mukul Gandhi [mailto:mukulg@apache.org]
Sent: Thursday, August 2, 2018 2:59 AM
To: Yitzhak Khabinsky <Yitzhak.Khabinsky@Millicom.com>
Cc: j-users@xerces.apache.org
Subject: Re: Xerces-J 2.12.0 vs. Saxon: XSD 1.1 CTA validation errors

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 query.

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<mailto: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 error.

> 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.




--
Regards,
Mukul Gandhi
Mime
View raw message