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 Xerces-J 2.12.0 vs. Saxon: XSD 1.1 CTA validation errors
Date Wed, 01 Aug 2018 18:44:26 GMT
Hi Mukul,

I bumped into the problems with the following:

  1.  CTA expression evaluation
  2.  base-uri(.) function

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

My tinkering:

  *   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.
  *   I wrapped the @OrganizationCode attribute in string() and xs:string() to no avail.
It continues to trip on search in sequences.
  *   The CTA expression doesn't accept "eq" instead of "=":
<xs:alternative test="@OrganizationCode eq '3TZ005'" type="AccountCode-TZ-Zantel"/>
  *   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

XSD fragment in question
<xs:element name="AccountCode" type="xs:string">
        <xs:alternative test="string(@OrganizationCode) = ('1GT001', '1GT005', '1GT006',
'1GT010', '1HN001', '1HN003', '1SV001', '2BO002', '2PY003', '2PY007')" type="AccountCode-GT-HN-SV-BO-PY"/>
        <xs:alternative test="@OrganizationCode = '2CO001'" type="AccountCode-CO-Mobile"/>
        <xs:alternative test="xs:string(@OrganizationCode) = ('2CO008', '2CO009')" type="AccountCode-CO-Fixed"/>
        <xs:alternative test="xs:string(@OrganizationCode) = ('3TZ001', '3TZ002', '3TZ003',
'3TZ004')" type="AccountCode-TZ"/>
        <xs:alternative test="@OrganizationCode = '3TZ005'" type="AccountCode-TZ-Zantel"/>
        <xs:alternative type="xs:error"/>
</xs:element>

XSD validation errors
[Error] IFRS15_CBC_In_Zantel.xsd:80:193: c-cta-xpath: The XPath expression 'string(@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_Zantel.xsd:82:110: c-cta-xpath: The XPath expression 'xs:string(@OrganizationCode)
= ('2CO008', '2CO009')' couldn't compile successfully in 'cta-subset' mode, during CTA evaluation.
[Error] IFRS15_CBC_In_Zantel.xsd:83:124: c-cta-xpath: The XPath expression 'xs:string(@OrganizationCode)
= ('3TZ001', '3TZ002', '3TZ003', '3TZ004')' couldn't compile successfully in 'cta-subset'
mode, during CTA evaluation.
[Error] id2938_TZ20171231_IFRS15_CBCInput_3TZ005.xml:6559:8: cvc-assertion: Assertion evaluation
('ends-with(upper-case(base-uri(.)), upper-case(concat('_', @OrganizationCode, '.xml')))')
for element 'root' on schema type '#AnonType_root' did not succeed.

Command Prompt
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/id2938_TZ20171231_IFRS15_CBCInput_3TZ005.xml"

The test case XML/XSD is in the attachment.

Thank you in advance.

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>


Mime
View raw message