[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xerces-j-dev
Subject:    Re: Xerces-J 2.12.0 vs. Saxon: XSD 1.1 gYearMonth comparison is failing
From:       Mukul Gandhi <mukulg () apache ! org>
Date:       2018-08-18 5:49:31
Message-ID: CABuuzNOxTa62nducvB_p+7AYzyMyuDebpQC-CDO5+20q=3eC2Q () mail ! gmail ! com
[Download RAW message or body]

Hi Yitzhak,
    I think, it would be ok if any bugs found for Eclipse / PsychoPath
XPath 2.0 processor in our 2.12.0 release, should be reported in Xerces
Jira. That would help us maintain the list of bugs in general. I hope we'll
find an appropriate way to fix these bugs in near future.

You could create the Xerces Jira issues, for the Eclipse / PsychoPath XPath
2.0 bugs you've found so far that we've discussed in recent threads.

On Wed, Aug 8, 2018 at 8:41 PM Yitzhak Khabinsky <
Yitzhak.Khabinsky@millicom.com> wrote:

> I have a requirement to validate that:
>
> *Each gYearMonth(Date) value shall not fall outside of a particular
> year-month range.*
>
> The test case XML/XSD is below.
>
>
>
> XML:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <root DataFeed="2018-07" xmlns="http://www.millicom.com" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
> http://www.millicom.com Test3.xsd">
>     <r>
>         <Date>2018-07-31</Date>
>     </r>
>     <r>
>         <Date>2018-07-25</Date>
>     </r>
> </root>
>
>
>
> XSD:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault=
> "qualified" version="4.4" targetNamespace="http://www.millicom.com" xmlns=
> "http://www.millicom.com" xpathDefaultNamespace="##targetNamespace"
> xmlns:saxon="http://saxon.sf.net/">
>     <xs:element name="root">
>         <xs:complexType>
>             <xs:sequence>
>                 <xs:element minOccurs="1" maxOccurs="unbounded" ref="r"/>
>             </xs:sequence>
>             <xs:attribute name="DataFeed" use="required" type=
> "xs:gYearMonth"/>
>
>             <xs:assert test="empty(r/Date[xs:gYearMonth(xs:date(.)) ne
> ../../xs:gYearMonth(@DataFeed)])" saxon:message="Rule #0: Each
> Year-Month(Date) value shall be equal to the DataFeed attribute value"
> xpathDefaultNamespace="##targetNamespace">
>                 <xs:annotation>
>                     <xs:documentation>Rule #0</xs:documentation>
>                     <xs:documentation>Each Year-Month(Date) value shall
> be equal to the DataFeed attribute value</xs:documentation>
>                 </xs:annotation>
>             </xs:assert>
>         </xs:complexType>
>     </xs:element>
>
>     <xs:element name="r">
>         <xs:complexType>
>             <xs:sequence>
>                 <xs:element name="Date" type="xs:date"/>
>             </xs:sequence>
>         </xs:complexType>
>     </xs:element>
> </xs:schema>
>
>
>
> Saxon correctly evaluates that the XML is valid.
>
>
>
> XercesJ emits the following error:
>
> [Error] Test3.xml:11:8: cvc-assertion: Assertion evaluation
> ('empty(r/Date[xs:gYearMonth(xs:date(.)) ne
> ../../xs:gYearMonth(@DataFeed)])') for element 'root' on schema type
> '#AnonType_root' did not succeed.
>




-- 
Regards,
Mukul Gandhi

[Attachment #3 (text/html)]

<div dir="ltr">Hi Yitzhak,<div>      I think, it would be ok if any bugs found for \
Eclipse / PsychoPath XPath 2.0 processor in our 2.12.0 release, should be reported in \
Xerces Jira. That would help us maintain the list of bugs in general. I hope \
we&#39;ll find an appropriate way to fix these bugs in near \
future.</div><div><br></div><div>You could create the Xerces Jira issues, for the \
Eclipse / PsychoPath XPath 2.0 bugs you&#39;ve found so far that we&#39;ve discussed \
in recent threads.</div><div><div><br><div class="gmail_quote"><div dir="ltr">On Wed, \
Aug 8, 2018 at 8:41 PM Yitzhak Khabinsky &lt;<a \
href="mailto:Yitzhak.Khabinsky@millicom.com">Yitzhak.Khabinsky@millicom.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="m_-8770856361165424968WordSection1">
<p class="MsoNormal"><span style="font-size:12pt">I have a requirement to validate \
that:</span><br></p> <p class="MsoNormal"><b>Each gYearMonth(Date) value shall not \
fall outside of a particular year-month range.<u></u><u></u></b></p> <p \
class="MsoNormal">The test case XML/XSD is below.<u></u><u></u></p> <p \
class="MsoNormal"><u></u>  <u></u></p> <p class="MsoNormal">XML:<u></u><u></u></p>
<p class="MsoNormal"><span style="color:blue">&lt;</span><span \
style="color:#602020">?xml version=&quot;1.0&quot; \
encoding=&quot;UTF-8&quot;?</span><span style="color:blue">&gt;</span><br> <span \
style="color:blue">&lt;</span><span style="color:#ac30bd">root </span><span \
style="color:#d00020">DataFeed=</span><span \
style="color:#000090">&quot;2018-07&quot;</span><span style="color:#d00020"> \
xmlns=</span><span style="color:#000090">&quot;<a href="http://www.millicom.com" \
target="_blank">http://www.millicom.com</a>&quot;</span><span style="color:#d00020">  \
xmlns:xsi=</span><span style="color:#000090">&quot;<a \
href="http://www.w3.org/2001/XMLSchema-instance" \
target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>&quot;</span><span \
style="color:#d00020"> xsi:schemaLocation=</span><span style="color:#000090">&quot;<a \
href="http://www.millicom.com" target="_blank">http://www.millicom.com</a> \
                Test3.xsd&quot;</span><span style="color:blue">&gt;</span><br>
        <span style="color:blue">&lt;</span><span style="color:#ac30bd">r</span><span \
style="color:blue">&gt;</span><br>  <span style="color:blue">&lt;</span><span \
style="color:#ac30bd">Date</span><span style="color:blue">&gt;</span>2018-07-31<span \
style="color:blue">&lt;</span><span style="color:#ac30bd">/Date</span><span \
                style="color:blue">&gt;</span><br>
        <span style="color:blue">&lt;</span><span \
                style="color:#ac30bd">/r</span><span \
                style="color:blue">&gt;</span><br>
        <span style="color:blue">&lt;</span><span style="color:#ac30bd">r</span><span \
style="color:blue">&gt;</span><br>  <span style="color:blue">&lt;</span><span \
style="color:#ac30bd">Date</span><span style="color:blue">&gt;</span>2018-07-25<span \
style="color:blue">&lt;</span><span style="color:#ac30bd">/Date</span><span \
                style="color:blue">&gt;</span><br>
        <span style="color:blue">&lt;</span><span \
style="color:#ac30bd">/r</span><span style="color:blue">&gt;</span><br> <span \
style="color:blue">&lt;</span><span style="color:#ac30bd">/root</span><span \
style="color:blue">&gt;</span> <u></u><u></u></p>
<p class="MsoNormal"><u></u>  <u></u></p>
<p class="MsoNormal">XSD:<u></u><u></u></p>
<p class="MsoNormal"><span style="color:blue">&lt;</span><span \
style="color:#602020">?xml version=&quot;1.0&quot; \
encoding=&quot;UTF-8&quot;?</span><span style="color:blue">&gt;</span><br> <span \
style="color:blue">&lt;</span><span style="color:#ac30bd">xs:schema </span><span \
style="color:#d00020">xmlns:xs=</span><span style="color:#000090">&quot;<a \
href="http://www.w3.org/2001/XMLSchema" \
target="_blank">http://www.w3.org/2001/XMLSchema</a>&quot;</span><span \
style="color:#d00020"> elementFormDefault=</span><span \
style="color:#000090">&quot;qualified&quot;</span><span style="color:#d00020">  \
version=</span><span style="color:#000090">&quot;4.4&quot;</span><span \
style="color:#d00020"> targetNamespace=</span><span style="color:#000090">&quot;<a \
href="http://www.millicom.com" \
target="_blank">http://www.millicom.com</a>&quot;</span><span style="color:#d00020"> \
xmlns=</span><span style="color:#000090">&quot;<a href="http://www.millicom.com" \
target="_blank">http://www.millicom.com</a>&quot;</span><span style="color:#d00020">  \
xpathDefaultNamespace=</span><span \
style="color:#000090">&quot;##targetNamespace&quot;</span><span \
style="color:#d00020"> xmlns:saxon=</span><span style="color:#000090">&quot;<a \
href="http://saxon.sf.net/" \
target="_blank">http://saxon.sf.net/</a>&quot;</span><span \
                style="color:blue">&gt;</span><br>
        <span style="color:blue">&lt;</span><span style="color:#ac30bd">xs:element \
</span> <span style="color:#d00020">name=</span><span \
                style="color:#000090">&quot;root&quot;</span><span \
                style="color:blue">&gt;</span><br>
                <span style="color:blue">&lt;</span><span \
                style="color:#ac30bd">xs:complexType</span><span \
                style="color:blue">&gt;</span><br>
                        <span style="color:blue">&lt;</span><span \
                style="color:#ac30bd">xs:sequence</span><span \
                style="color:blue">&gt;</span><br>
                                <span style="color:blue">&lt;</span><span \
style="color:#ac30bd">xs:element </span><span \
style="color:#d00020">minOccurs=</span><span \
style="color:#000090">&quot;1&quot;</span><span style="color:#d00020"> \
maxOccurs=</span><span style="color:#000090">&quot;unbounded&quot;</span><span \
style="color:#d00020"> ref=</span><span \
style="color:#000090">&quot;r&quot;</span><span style="color:#d00020">/</span><span \
                style="color:blue">&gt;</span><br>
                        <span style="color:blue">&lt;</span><span \
                style="color:#ac30bd">/xs:sequence</span><span \
                style="color:blue">&gt;</span><br>
                        <span style="color:blue">&lt;</span><span \
style="color:#ac30bd">xs:attribute </span><span \
style="color:#d00020">name=</span><span \
style="color:#000090">&quot;DataFeed&quot;</span><span style="color:#d00020"> \
use=</span><span style="color:#000090">&quot;required&quot;</span><span \
style="color:#d00020"> type=</span><span \
style="color:#000090">&quot;xs:gYearMonth&quot;</span><span \
style="color:#d00020">/</span><span style="color:blue">&gt;</span><br> <br>
                        <span style="color:blue">&lt;</span><span \
style="color:#ea8f0f">xs:assert </span><span style="color:#d00020">test=</span><span \
style="color:#000090">&quot;empty(r/Date[xs:gYearMonth(xs:date(.)) ne \
../../xs:gYearMonth(@DataFeed)])&quot;</span><span style="color:#d00020"> \
saxon:message=</span><span style="color:#000090">&quot;Rule #0: Each Year-Month(Date) \
value shall be equal to the DataFeed attribute value&quot;</span><span \
style="color:#d00020"> xpathDefaultNamespace=</span><span \
style="color:#000090">&quot;##targetNamespace&quot;</span><span \
                style="color:blue">&gt;</span><br>
                                <span style="color:blue">&lt;</span><span \
style="color:#ac30bd">xs:annotation</span><span style="color:blue">&gt;</span><br>  \
<span style="color:blue">&lt;</span><span \
style="color:#ac30bd">xs:documentation</span><span style="color:blue">&gt;</span>Rule \
#0<span style="color:blue">&lt;</span><span \
style="color:#ac30bd">/xs:documentation</span><span \
style="color:blue">&gt;</span><br>  <span style="color:blue">&lt;</span><span \
style="color:#ac30bd">xs:documentation</span><span style="color:blue">&gt;</span>Each \
Year-Month(Date) value shall be equal to the DataFeed attribute value<span \
style="color:blue">&lt;</span><span \
style="color:#ac30bd">/xs:documentation</span><span \
                style="color:blue">&gt;</span><br>
                                <span style="color:blue">&lt;</span><span \
                style="color:#ac30bd">/xs:annotation</span><span \
                style="color:blue">&gt;</span><br>
                        <span style="color:blue">&lt;</span><span \
                style="color:#ea8f0f">/xs:assert</span><span \
                style="color:blue">&gt;</span><br>
                <span style="color:blue">&lt;</span><span \
                style="color:#ac30bd">/xs:complexType</span><span \
                style="color:blue">&gt;</span><br>
        <span style="color:blue">&lt;</span><span \
style="color:#ac30bd">/xs:element</span><span style="color:blue">&gt;</span><br> <br>
        <span style="color:blue">&lt;</span><span style="color:#ac30bd">xs:element \
</span> <span style="color:#d00020">name=</span><span \
                style="color:#000090">&quot;r&quot;</span><span \
                style="color:blue">&gt;</span><br>
                <span style="color:blue">&lt;</span><span \
                style="color:#ac30bd">xs:complexType</span><span \
                style="color:blue">&gt;</span><br>
                        <span style="color:blue">&lt;</span><span \
                style="color:#ac30bd">xs:sequence</span><span \
                style="color:blue">&gt;</span><br>
                                <span style="color:blue">&lt;</span><span \
style="color:#ac30bd">xs:element </span><span style="color:#d00020">name=</span><span \
style="color:#000090">&quot;Date&quot;</span><span style="color:#d00020"> \
type=</span><span style="color:#000090">&quot;xs:date&quot;</span><span \
                style="color:#d00020">/</span><span \
                style="color:blue">&gt;</span><br>
                        <span style="color:blue">&lt;</span><span \
                style="color:#ac30bd">/xs:sequence</span><span \
                style="color:blue">&gt;</span><br>
                <span style="color:blue">&lt;</span><span \
                style="color:#ac30bd">/xs:complexType</span><span \
                style="color:blue">&gt;</span><br>
        <span style="color:blue">&lt;</span><span \
style="color:#ac30bd">/xs:element</span><span style="color:blue">&gt;</span><br> \
<span style="color:blue">&lt;</span><span \
style="color:#ac30bd">/xs:schema</span><span style="color:blue">&gt;</span> \
<u></u><u></u></p> <p class="MsoNormal"><u></u>  <u></u></p>
<p class="MsoNormal">Saxon correctly evaluates that the XML is \
valid.<u></u><u></u></p> <p class="MsoNormal"><u></u>  <u></u></p>
<p class="MsoNormal">XercesJ emits the following error:<u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;;color:#600000">[Error] Test3.xml:11:8: cvc-assertion: Assertion evaluation \
(&#39;empty(r/Date[xs:gYearMonth(xs:date(.)) ne \
../../xs:gYearMonth(@DataFeed)])&#39;) for element &#39;root&#39; on schema  type \
&#39;#AnonType_root&#39; did not \
succeed.</span></p></div></div></blockquote><div><br></div><div>  </div></div><br \
clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" \
data-smartmail="gmail_signature">Regards,<br>Mukul Gandhi</div></div></div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic