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 gYearMonth comparison is failing
Date Thu, 09 Aug 2018 13:54:12 GMT
Hi Mukul,

The expression in the assert is working in Saxon with flying colors.
The idea is to use the gYearMonth data type so it will check correctness of both year and
month portions of it.

The real limitation is that the XSD 1.1 standard prevents use of the inheritable attributes
in the asserts which is the opposite from what CTAs allow.
So it forces the assert to work just once in one-to-many fashion, i.e. <root> where
@DataFeed attribute resides vs. multiple <r> with the Date elements in this case.

Please see the screenshots below.
They show that there is nothing wrong with the XPath expression.

[cid:image001.png@01D42FC5.A0F39DD0]

[cid:image002.png@01D42FC5.A0F39DD0]

Regards,
Yitzhak Khabinsky

From: Mukul Gandhi [mailto:mukulg@apache.org]
Sent: Thursday, August 9, 2018 1:18 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 gYearMonth comparison is failing

Hi Yitzhak,

On Wed, Aug 8, 2018 at 8:41 PM, Yitzhak Khabinsky <Yitzhak.Khabinsky@millicom.com<mailto:Yitzhak.Khabinsky@millicom.com>>
wrote:
            <xs:assert test="empty(r/Date[xs:gYearMonth(xs:date(.)) ne ../../xs:gYearMonth(@DataFeed)])"

I can't exactly debug your above XPath expression quickly. I'm sure, someone from Xerces team
or community will offer advise about above XPath expression asap, in relation to XSD 1.1 <assert>.

In the meantime, I can offer following XPath 2.0 expressions as workaround for your usecase,
which seem to work with Xerces.

empty(r/Date[substring(string(.),0,8) ne string(../../@DataFeed)<mailto:../../@DataFeed)>])

or

every $d in r/Date satisfies substring(string($d),0,8) eq string(@DataFeed)





--
Regards,
Mukul Gandhi


This message (including any attachments) may contain confidential, proprietary, privileged
and/or private information. The information is intended to be for the use of the individual
or entity designated above. If you are not the intended recipient of this message or have
received this transmission in error, please notify the sender immediately, and delete the
message and any attachments. Any disclosure, reproduction, distribution or other use of this
message or any attachments by an individual or entity other than the intended recipient is
prohibited.

Este mensaje (incluido cualquiera de sus anexos) puede contener información confidencial,
privilegiada, propietaria, y/o privada. La información está destinada para el uso del individuo
o la entidad designada arriba. Si usted no es el destinatario de este mensaje o ha recibido
este mensaje por error, por favor notifique a su remitente inmediatamente, y elimine el mensaje
y cualquiera de sus anexos. Se prohíbe cualquier revelación, reproducción, distribución
u otro uso de este mensaje o cualquiera de sus anexos que sea realizado por un individuo o
una entidad diferente al destinatario.
Mime
View raw message