You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Mukul Gandhi (JIRA)" <xe...@xml.apache.org> on 2011/02/10 10:11:57 UTC

[jira] Created: (XERCESJ-1496) adding new feature to JAXP validator for folded simpleType->list assertions evaluation

adding new feature to JAXP validator for folded simpleType->list assertions evaluation
--------------------------------------------------------------------------------------

                 Key: XERCESJ-1496
                 URL: https://issues.apache.org/jira/browse/XERCESJ-1496
             Project: Xerces2-J
          Issue Type: Improvement
          Components: XML Schema 1.1 Structures
    Affects Versions: 2.11.0
            Reporter: Mukul Gandhi
            Assignee: Mukul Gandhi
            Priority: Minor


Here' a description of the rationale and benefits of this change, and a small schema 1.1 validation use case illustrating the proposed changes.

One of the test cases in W3C XML Schema 1.1 test suite is as follows:

XML document [1]:
<list>1 2 3 4 5</list>

XML Schema document [2]:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
   
    <xs:element name="list">
         <xs:simpleType>
	     <xs:list>
	         <xs:simpleType>
	             <xs:restriction base="xs:integer">
	                 <xs:assertion test="count($value) eq count(distinct-values($value))" />
	             </xs:restriction>
	         </xs:simpleType>
	     </xs:list>
         </xs:simpleType>
    </xs:element>
   
</xs:schema>

The assertion facet in this example would mean,
"there must be no duplicates in the list"

Xerces (before this change) didn't support an use case like above. For the above example Xerces evaluates assertion for each list item (therefore Xerces would make 5 calls to an assertion for this example, and the XPath 2 context variable $value being different/"list item" in each iteration) -- but this would not serve the purpose of this use case.

I believe we must support this use case. To support this facility I propose a change along the following lines:
Introduce a new feature on JAXP validator with name "http://apache.org/xml/features/validation/foldedSTlist-assertion-evaluation" whose default value is an boolean 'false' (therefore not setting this feature or making it explicitly 'false' would retain the current Xerces behavior). Setting this feature to 'true' would cause assertion evaluation as required by the above use case.

The current Xerces implementation to evaluate assertion facet on each list item is also beneficial; for example with a schema 1.1 fragment something like below:
<xs:element name="list">
     <xs:simpleType>
        <xs:list>
	   <xs:simpleType>
	       <xs:restriction base="xs:integer">
	           <xs:assertion test="$value mod 2 = 0" />
	       </xs:restriction>
	   </xs:simpleType>
        </xs:list>
    </xs:simpleType>
</xs:element>

(the assertion failure error messages in this example would tell us, that what all list items didn't pass the test AND I believe that this run-time behavior is also useful)

To summarize this change:
1. Setting the mentioned JAXP feature to 'true' would cause assertion to be evaluated only once on the entire list (which would have a type annotation xs:anyAtomicType*).
2. Not setting this JAXP feature explicitly (since it's default value is 'false' within Xerces XML Schema 1.1 validator), or setting explicitly it's value to 'false' would retain the current Xerces behavior as has been explained above.

I hope that this enhancement is useful. I'll shortly be committing changes for this facility (along with related support in jaxp.SourceValidator sample). Any comments about this change would be helpful to us.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


[jira] Updated: (XERCESJ-1496) adding new feature to JAXP validator for folded simpleType->list assertions evaluation

Posted by "Mukul Gandhi (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESJ-1496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mukul Gandhi updated XERCESJ-1496:
----------------------------------

    Description: 
Here's a description of the rationale and benefits of this change, and a small schema 1.1 validation use case illustrating the proposed changes.

One of the test cases in W3C XML Schema 1.1 test suite is as follows:

XML document [1]:
<list>1 2 3 4 5</list>

XML Schema 1.1 document [2]:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
   
    <xs:element name="list">
         <xs:simpleType>
	     <xs:list>
	         <xs:simpleType>
	             <xs:restriction base="xs:integer">
	                 <xs:assertion test="count($value) eq count(distinct-values($value))" />
	             </xs:restriction>
	         </xs:simpleType>
	     </xs:list>
         </xs:simpleType>
    </xs:element>
   
</xs:schema>

The assertion facet in this example would mean,
"there must be no duplicates in the list"

Xerces (before this change) didn't support an use case like above. For the above example currently Xerces evaluates assertion for each list item (therefore Xerces would make 5 calls to an assertion for this example, and the XPath 2 context variable $value being different/"list item" in each iteration) -- but this would not serve the purpose of this use case.

I believe we must support this use case. To support this facility I propose a change along the following lines:
We introduce a new feature on JAXP validator with name "http://apache.org/xml/features/validation/foldedSTlist-assertion-evaluation" whose default value is an boolean 'false' (therefore not setting this feature or making it explicitly 'false' would retain the current Xerces behavior). Setting this feature to 'true' would cause assertion evaluation as required by the above use case.

The current Xerces implementation to evaluate assertion facet on each list item is also beneficial; for example with a schema 1.1 fragment something like below:
<xs:element name="list">
     <xs:simpleType>
        <xs:list>
	   <xs:simpleType>
	       <xs:restriction base="xs:integer">
	           <xs:assertion test="$value mod 2 = 0" />
	       </xs:restriction>
	   </xs:simpleType>
        </xs:list>
    </xs:simpleType>
</xs:element>

(the assertion failure error messages in this example would tell us, that what all list items didn't pass the test AND I believe that this run-time behavior is also useful)

To summarize this change:
1. Setting the mentioned JAXP feature to 'true' would cause assertion to be evaluated only once on the entire list (which would have a type annotation xs:anyAtomicType*).
2. Not setting this JAXP feature explicitly (since it's default value is 'false' within Xerces XML Schema 1.1 validator), or setting explicitly it's value to 'false' would retain the current Xerces behavior as has been explained above.

I hope that this enhancement is useful. I'll shortly be committing changes for this facility (along with related support to jaxp.SourceValidator sample). Any comments about this change would be helpful to us.

  was:
Here' a description of the rationale and benefits of this change, and a small schema 1.1 validation use case illustrating the proposed changes.

One of the test cases in W3C XML Schema 1.1 test suite is as follows:

XML document [1]:
<list>1 2 3 4 5</list>

XML Schema document [2]:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
   
    <xs:element name="list">
         <xs:simpleType>
	     <xs:list>
	         <xs:simpleType>
	             <xs:restriction base="xs:integer">
	                 <xs:assertion test="count($value) eq count(distinct-values($value))" />
	             </xs:restriction>
	         </xs:simpleType>
	     </xs:list>
         </xs:simpleType>
    </xs:element>
   
</xs:schema>

The assertion facet in this example would mean,
"there must be no duplicates in the list"

Xerces (before this change) didn't support an use case like above. For the above example Xerces evaluates assertion for each list item (therefore Xerces would make 5 calls to an assertion for this example, and the XPath 2 context variable $value being different/"list item" in each iteration) -- but this would not serve the purpose of this use case.

I believe we must support this use case. To support this facility I propose a change along the following lines:
Introduce a new feature on JAXP validator with name "http://apache.org/xml/features/validation/foldedSTlist-assertion-evaluation" whose default value is an boolean 'false' (therefore not setting this feature or making it explicitly 'false' would retain the current Xerces behavior). Setting this feature to 'true' would cause assertion evaluation as required by the above use case.

The current Xerces implementation to evaluate assertion facet on each list item is also beneficial; for example with a schema 1.1 fragment something like below:
<xs:element name="list">
     <xs:simpleType>
        <xs:list>
	   <xs:simpleType>
	       <xs:restriction base="xs:integer">
	           <xs:assertion test="$value mod 2 = 0" />
	       </xs:restriction>
	   </xs:simpleType>
        </xs:list>
    </xs:simpleType>
</xs:element>

(the assertion failure error messages in this example would tell us, that what all list items didn't pass the test AND I believe that this run-time behavior is also useful)

To summarize this change:
1. Setting the mentioned JAXP feature to 'true' would cause assertion to be evaluated only once on the entire list (which would have a type annotation xs:anyAtomicType*).
2. Not setting this JAXP feature explicitly (since it's default value is 'false' within Xerces XML Schema 1.1 validator), or setting explicitly it's value to 'false' would retain the current Xerces behavior as has been explained above.

I hope that this enhancement is useful. I'll shortly be committing changes for this facility (along with related support in jaxp.SourceValidator sample). Any comments about this change would be helpful to us.


> adding new feature to JAXP validator for folded simpleType->list assertions evaluation
> --------------------------------------------------------------------------------------
>
>                 Key: XERCESJ-1496
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1496
>             Project: Xerces2-J
>          Issue Type: Improvement
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>            Reporter: Mukul Gandhi
>            Assignee: Mukul Gandhi
>            Priority: Minor
>
> Here's a description of the rationale and benefits of this change, and a small schema 1.1 validation use case illustrating the proposed changes.
> One of the test cases in W3C XML Schema 1.1 test suite is as follows:
> XML document [1]:
> <list>1 2 3 4 5</list>
> XML Schema 1.1 document [2]:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
>    
>     <xs:element name="list">
>          <xs:simpleType>
> 	     <xs:list>
> 	         <xs:simpleType>
> 	             <xs:restriction base="xs:integer">
> 	                 <xs:assertion test="count($value) eq count(distinct-values($value))" />
> 	             </xs:restriction>
> 	         </xs:simpleType>
> 	     </xs:list>
>          </xs:simpleType>
>     </xs:element>
>    
> </xs:schema>
> The assertion facet in this example would mean,
> "there must be no duplicates in the list"
> Xerces (before this change) didn't support an use case like above. For the above example currently Xerces evaluates assertion for each list item (therefore Xerces would make 5 calls to an assertion for this example, and the XPath 2 context variable $value being different/"list item" in each iteration) -- but this would not serve the purpose of this use case.
> I believe we must support this use case. To support this facility I propose a change along the following lines:
> We introduce a new feature on JAXP validator with name "http://apache.org/xml/features/validation/foldedSTlist-assertion-evaluation" whose default value is an boolean 'false' (therefore not setting this feature or making it explicitly 'false' would retain the current Xerces behavior). Setting this feature to 'true' would cause assertion evaluation as required by the above use case.
> The current Xerces implementation to evaluate assertion facet on each list item is also beneficial; for example with a schema 1.1 fragment something like below:
> <xs:element name="list">
>      <xs:simpleType>
>         <xs:list>
> 	   <xs:simpleType>
> 	       <xs:restriction base="xs:integer">
> 	           <xs:assertion test="$value mod 2 = 0" />
> 	       </xs:restriction>
> 	   </xs:simpleType>
>         </xs:list>
>     </xs:simpleType>
> </xs:element>
> (the assertion failure error messages in this example would tell us, that what all list items didn't pass the test AND I believe that this run-time behavior is also useful)
> To summarize this change:
> 1. Setting the mentioned JAXP feature to 'true' would cause assertion to be evaluated only once on the entire list (which would have a type annotation xs:anyAtomicType*).
> 2. Not setting this JAXP feature explicitly (since it's default value is 'false' within Xerces XML Schema 1.1 validator), or setting explicitly it's value to 'false' would retain the current Xerces behavior as has been explained above.
> I hope that this enhancement is useful. I'll shortly be committing changes for this facility (along with related support to jaxp.SourceValidator sample). Any comments about this change would be helpful to us.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


[jira] Resolved: (XERCESJ-1496) adding new feature to JAXP validator for folded simpleType->list assertions evaluation

Posted by "Mukul Gandhi (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESJ-1496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mukul Gandhi resolved XERCESJ-1496.
-----------------------------------

    Resolution: Invalid

i'm marking this bug report as invalid, since we decided that a JAXP feature for this functionality is not needed. The commits made for the discussed functionality were normal bug fixes.

> adding new feature to JAXP validator for folded simpleType->list assertions evaluation
> --------------------------------------------------------------------------------------
>
>                 Key: XERCESJ-1496
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1496
>             Project: Xerces2-J
>          Issue Type: Improvement
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>            Reporter: Mukul Gandhi
>            Assignee: Mukul Gandhi
>            Priority: Minor
>
> Here's a description of the rationale and benefits of this change, and a small schema 1.1 validation use case illustrating the proposed changes.
> One of the test cases in W3C XML Schema 1.1 test suite is as follows:
> XML document [1]:
> <list>1 2 3 4 5</list>
> XML Schema 1.1 document [2]:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
>    
>     <xs:element name="list">
>          <xs:simpleType>
> 	     <xs:list>
> 	         <xs:simpleType>
> 	             <xs:restriction base="xs:integer">
> 	                 <xs:assertion test="count($value) eq count(distinct-values($value))" />
> 	             </xs:restriction>
> 	         </xs:simpleType>
> 	     </xs:list>
>          </xs:simpleType>
>     </xs:element>
>    
> </xs:schema>
> The assertion facet in this example would mean,
> "there must be no duplicates in the list"
> Xerces (before this change) didn't support an use case like above. For the above example currently Xerces evaluates assertion for each list item (therefore Xerces would make 5 calls to an assertion for this example, and the XPath 2 context variable $value being different/"list item" in each iteration) -- but this would not serve the purpose of this use case.
> I believe we must support this use case. To support this facility I propose a change along the following lines:
> We introduce a new feature on JAXP validator with name "http://apache.org/xml/features/validation/foldedSTlist-assertion-evaluation" whose default value is an boolean 'false' (therefore not setting this feature or making it explicitly 'false' would retain the current Xerces behavior). Setting this feature to 'true' would cause assertion evaluation as required by the above use case.
> The current Xerces implementation to evaluate assertion facet on each list item is also beneficial; for example with a schema 1.1 fragment something like below:
> <xs:element name="list">
>      <xs:simpleType>
>         <xs:list>
> 	   <xs:simpleType>
> 	       <xs:restriction base="xs:integer">
> 	           <xs:assertion test="$value mod 2 = 0" />
> 	       </xs:restriction>
> 	   </xs:simpleType>
>         </xs:list>
>     </xs:simpleType>
> </xs:element>
> (the assertion failure error messages in this example would tell us, that what all list items didn't pass the test AND I believe that this run-time behavior is also useful)
> To summarize this change:
> 1. Setting the mentioned JAXP feature to 'true' would cause assertion to be evaluated only once on the entire list (which would have a type annotation xs:anyAtomicType*).
> 2. Not setting this JAXP feature explicitly (since it's default value is 'false' within Xerces XML Schema 1.1 validator), or setting explicitly it's value to 'false' would retain the current Xerces behavior as has been explained above.
> I hope that this enhancement is useful. I'll shortly be committing changes for this facility (along with related support to jaxp.SourceValidator sample). Any comments about this change would be helpful to us.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


[jira] Commented: (XERCESJ-1496) adding new feature to JAXP validator for folded simpleType->list assertions evaluation

Posted by "Mukul Gandhi (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12994011#comment-12994011 ] 

Mukul Gandhi commented on XERCESJ-1496:
---------------------------------------

Hi Michael & Khaled,
    I've committed few improvements for issues as highlighted in in this JIRA issue, as per your suggestions. Now we don't have a JAXP feature implementation for this functionality -- those changes were reverted back (as has been suggested by you, and I agree to this idea). 

I think my latest commit to Xerces code-base has likely resolved the problems that are been discussed in this thread. You could verify the changes and suggest any improvements.

Regards,
Mukul

> adding new feature to JAXP validator for folded simpleType->list assertions evaluation
> --------------------------------------------------------------------------------------
>
>                 Key: XERCESJ-1496
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1496
>             Project: Xerces2-J
>          Issue Type: Improvement
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>            Reporter: Mukul Gandhi
>            Assignee: Mukul Gandhi
>            Priority: Minor
>
> Here's a description of the rationale and benefits of this change, and a small schema 1.1 validation use case illustrating the proposed changes.
> One of the test cases in W3C XML Schema 1.1 test suite is as follows:
> XML document [1]:
> <list>1 2 3 4 5</list>
> XML Schema 1.1 document [2]:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
>    
>     <xs:element name="list">
>          <xs:simpleType>
> 	     <xs:list>
> 	         <xs:simpleType>
> 	             <xs:restriction base="xs:integer">
> 	                 <xs:assertion test="count($value) eq count(distinct-values($value))" />
> 	             </xs:restriction>
> 	         </xs:simpleType>
> 	     </xs:list>
>          </xs:simpleType>
>     </xs:element>
>    
> </xs:schema>
> The assertion facet in this example would mean,
> "there must be no duplicates in the list"
> Xerces (before this change) didn't support an use case like above. For the above example currently Xerces evaluates assertion for each list item (therefore Xerces would make 5 calls to an assertion for this example, and the XPath 2 context variable $value being different/"list item" in each iteration) -- but this would not serve the purpose of this use case.
> I believe we must support this use case. To support this facility I propose a change along the following lines:
> We introduce a new feature on JAXP validator with name "http://apache.org/xml/features/validation/foldedSTlist-assertion-evaluation" whose default value is an boolean 'false' (therefore not setting this feature or making it explicitly 'false' would retain the current Xerces behavior). Setting this feature to 'true' would cause assertion evaluation as required by the above use case.
> The current Xerces implementation to evaluate assertion facet on each list item is also beneficial; for example with a schema 1.1 fragment something like below:
> <xs:element name="list">
>      <xs:simpleType>
>         <xs:list>
> 	   <xs:simpleType>
> 	       <xs:restriction base="xs:integer">
> 	           <xs:assertion test="$value mod 2 = 0" />
> 	       </xs:restriction>
> 	   </xs:simpleType>
>         </xs:list>
>     </xs:simpleType>
> </xs:element>
> (the assertion failure error messages in this example would tell us, that what all list items didn't pass the test AND I believe that this run-time behavior is also useful)
> To summarize this change:
> 1. Setting the mentioned JAXP feature to 'true' would cause assertion to be evaluated only once on the entire list (which would have a type annotation xs:anyAtomicType*).
> 2. Not setting this JAXP feature explicitly (since it's default value is 'false' within Xerces XML Schema 1.1 validator), or setting explicitly it's value to 'false' would retain the current Xerces behavior as has been explained above.
> I hope that this enhancement is useful. I'll shortly be committing changes for this facility (along with related support to jaxp.SourceValidator sample). Any comments about this change would be helpful to us.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


[jira] Commented: (XERCESJ-1496) adding new feature to JAXP validator for folded simpleType->list assertions evaluation

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993200#comment-12993200 ] 

Michael Glavassevich commented on XERCESJ-1496:
-----------------------------------------------

Mukul, it seems like new behaviour introduced by this feature (when set to true) is a bug fix and that the current behaviour (when the feature is set to false) is a defect. It's unusual to fix a bug by introducing a new JAXP feature, especially when the default is to continue supporting the buggy behaviour. Remember that the XML Schema 1.1 spec and the implementation in Xerces are still in development. I doubt that any of our users would have a dependency on the current behaviour or an expectation that things are stable since we've clearly told them that this is experimental stuff at the moment. Can we fix the issue discovered by this W3C test cleanly and not introduce a new feature?

> adding new feature to JAXP validator for folded simpleType->list assertions evaluation
> --------------------------------------------------------------------------------------
>
>                 Key: XERCESJ-1496
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1496
>             Project: Xerces2-J
>          Issue Type: Improvement
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>            Reporter: Mukul Gandhi
>            Assignee: Mukul Gandhi
>            Priority: Minor
>
> Here's a description of the rationale and benefits of this change, and a small schema 1.1 validation use case illustrating the proposed changes.
> One of the test cases in W3C XML Schema 1.1 test suite is as follows:
> XML document [1]:
> <list>1 2 3 4 5</list>
> XML Schema 1.1 document [2]:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
>    
>     <xs:element name="list">
>          <xs:simpleType>
> 	     <xs:list>
> 	         <xs:simpleType>
> 	             <xs:restriction base="xs:integer">
> 	                 <xs:assertion test="count($value) eq count(distinct-values($value))" />
> 	             </xs:restriction>
> 	         </xs:simpleType>
> 	     </xs:list>
>          </xs:simpleType>
>     </xs:element>
>    
> </xs:schema>
> The assertion facet in this example would mean,
> "there must be no duplicates in the list"
> Xerces (before this change) didn't support an use case like above. For the above example currently Xerces evaluates assertion for each list item (therefore Xerces would make 5 calls to an assertion for this example, and the XPath 2 context variable $value being different/"list item" in each iteration) -- but this would not serve the purpose of this use case.
> I believe we must support this use case. To support this facility I propose a change along the following lines:
> We introduce a new feature on JAXP validator with name "http://apache.org/xml/features/validation/foldedSTlist-assertion-evaluation" whose default value is an boolean 'false' (therefore not setting this feature or making it explicitly 'false' would retain the current Xerces behavior). Setting this feature to 'true' would cause assertion evaluation as required by the above use case.
> The current Xerces implementation to evaluate assertion facet on each list item is also beneficial; for example with a schema 1.1 fragment something like below:
> <xs:element name="list">
>      <xs:simpleType>
>         <xs:list>
> 	   <xs:simpleType>
> 	       <xs:restriction base="xs:integer">
> 	           <xs:assertion test="$value mod 2 = 0" />
> 	       </xs:restriction>
> 	   </xs:simpleType>
>         </xs:list>
>     </xs:simpleType>
> </xs:element>
> (the assertion failure error messages in this example would tell us, that what all list items didn't pass the test AND I believe that this run-time behavior is also useful)
> To summarize this change:
> 1. Setting the mentioned JAXP feature to 'true' would cause assertion to be evaluated only once on the entire list (which would have a type annotation xs:anyAtomicType*).
> 2. Not setting this JAXP feature explicitly (since it's default value is 'false' within Xerces XML Schema 1.1 validator), or setting explicitly it's value to 'false' would retain the current Xerces behavior as has been explained above.
> I hope that this enhancement is useful. I'll shortly be committing changes for this facility (along with related support to jaxp.SourceValidator sample). Any comments about this change would be helpful to us.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


[jira] Commented: (XERCESJ-1496) adding new feature to JAXP validator for folded simpleType->list assertions evaluation

Posted by "Mukul Gandhi (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993347#comment-12993347 ] 

Mukul Gandhi commented on XERCESJ-1496:
---------------------------------------

As per observation from Michael,

Ref:
<xs:element name="list">
     <xs:simpleType>
         <xs:restriction>
             <xs:simpleType>
                <xs:list itemType="xs:integer"/>
            </xs:simpleType>
            <xs:assertion test="count($value) eq count(distinct-values($value))" />
         </xs:restriction>
     </xs:simpleType>
</xs:element>

Is the following understanding correct?
1. If the assertion is defined on the type at the level of list (as in the above example), then assertion is evaluated on the entire list.
2. If the assertion is defined on the itemType of the list, then assertion is evaluated on all of list items.
3. We don't need the new feature introduced (and we just need to implement cases 1 & 2).

After we agree upon the correct design for these uses cases, I would accordingly revert the code base and correct the implementation. 

> adding new feature to JAXP validator for folded simpleType->list assertions evaluation
> --------------------------------------------------------------------------------------
>
>                 Key: XERCESJ-1496
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1496
>             Project: Xerces2-J
>          Issue Type: Improvement
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>            Reporter: Mukul Gandhi
>            Assignee: Mukul Gandhi
>            Priority: Minor
>
> Here's a description of the rationale and benefits of this change, and a small schema 1.1 validation use case illustrating the proposed changes.
> One of the test cases in W3C XML Schema 1.1 test suite is as follows:
> XML document [1]:
> <list>1 2 3 4 5</list>
> XML Schema 1.1 document [2]:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
>    
>     <xs:element name="list">
>          <xs:simpleType>
> 	     <xs:list>
> 	         <xs:simpleType>
> 	             <xs:restriction base="xs:integer">
> 	                 <xs:assertion test="count($value) eq count(distinct-values($value))" />
> 	             </xs:restriction>
> 	         </xs:simpleType>
> 	     </xs:list>
>          </xs:simpleType>
>     </xs:element>
>    
> </xs:schema>
> The assertion facet in this example would mean,
> "there must be no duplicates in the list"
> Xerces (before this change) didn't support an use case like above. For the above example currently Xerces evaluates assertion for each list item (therefore Xerces would make 5 calls to an assertion for this example, and the XPath 2 context variable $value being different/"list item" in each iteration) -- but this would not serve the purpose of this use case.
> I believe we must support this use case. To support this facility I propose a change along the following lines:
> We introduce a new feature on JAXP validator with name "http://apache.org/xml/features/validation/foldedSTlist-assertion-evaluation" whose default value is an boolean 'false' (therefore not setting this feature or making it explicitly 'false' would retain the current Xerces behavior). Setting this feature to 'true' would cause assertion evaluation as required by the above use case.
> The current Xerces implementation to evaluate assertion facet on each list item is also beneficial; for example with a schema 1.1 fragment something like below:
> <xs:element name="list">
>      <xs:simpleType>
>         <xs:list>
> 	   <xs:simpleType>
> 	       <xs:restriction base="xs:integer">
> 	           <xs:assertion test="$value mod 2 = 0" />
> 	       </xs:restriction>
> 	   </xs:simpleType>
>         </xs:list>
>     </xs:simpleType>
> </xs:element>
> (the assertion failure error messages in this example would tell us, that what all list items didn't pass the test AND I believe that this run-time behavior is also useful)
> To summarize this change:
> 1. Setting the mentioned JAXP feature to 'true' would cause assertion to be evaluated only once on the entire list (which would have a type annotation xs:anyAtomicType*).
> 2. Not setting this JAXP feature explicitly (since it's default value is 'false' within Xerces XML Schema 1.1 validator), or setting explicitly it's value to 'false' would retain the current Xerces behavior as has been explained above.
> I hope that this enhancement is useful. I'll shortly be committing changes for this facility (along with related support to jaxp.SourceValidator sample). Any comments about this change would be helpful to us.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


[jira] Commented: (XERCESJ-1496) adding new feature to JAXP validator for folded simpleType->list assertions evaluation

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993227#comment-12993227 ] 

Michael Glavassevich commented on XERCESJ-1496:
-----------------------------------------------

I kind of glossed over the examples when I wrote my first comment, but taking a deeper look at the W3C test, I wonder if the real issue is that the test is invalid (or doesn't test what it intended). If the author wanted the assertion to apply to the list as whole I would have expected to see a restriction of the list type not its item type, for example:

<xs:element name="list">
 <xs:simpleType>
  <xs:restriction>
   <xs:simpleType>
    <xs:list itemType="xs:integer"/>
   </xs:simpleType>
   <xs:assertion test="count($value) eq count(distinct-values($value))" />
  </xs:restriction>
 </xs:simpleType>
</xs:element>

> adding new feature to JAXP validator for folded simpleType->list assertions evaluation
> --------------------------------------------------------------------------------------
>
>                 Key: XERCESJ-1496
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1496
>             Project: Xerces2-J
>          Issue Type: Improvement
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>            Reporter: Mukul Gandhi
>            Assignee: Mukul Gandhi
>            Priority: Minor
>
> Here's a description of the rationale and benefits of this change, and a small schema 1.1 validation use case illustrating the proposed changes.
> One of the test cases in W3C XML Schema 1.1 test suite is as follows:
> XML document [1]:
> <list>1 2 3 4 5</list>
> XML Schema 1.1 document [2]:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
>    
>     <xs:element name="list">
>          <xs:simpleType>
> 	     <xs:list>
> 	         <xs:simpleType>
> 	             <xs:restriction base="xs:integer">
> 	                 <xs:assertion test="count($value) eq count(distinct-values($value))" />
> 	             </xs:restriction>
> 	         </xs:simpleType>
> 	     </xs:list>
>          </xs:simpleType>
>     </xs:element>
>    
> </xs:schema>
> The assertion facet in this example would mean,
> "there must be no duplicates in the list"
> Xerces (before this change) didn't support an use case like above. For the above example currently Xerces evaluates assertion for each list item (therefore Xerces would make 5 calls to an assertion for this example, and the XPath 2 context variable $value being different/"list item" in each iteration) -- but this would not serve the purpose of this use case.
> I believe we must support this use case. To support this facility I propose a change along the following lines:
> We introduce a new feature on JAXP validator with name "http://apache.org/xml/features/validation/foldedSTlist-assertion-evaluation" whose default value is an boolean 'false' (therefore not setting this feature or making it explicitly 'false' would retain the current Xerces behavior). Setting this feature to 'true' would cause assertion evaluation as required by the above use case.
> The current Xerces implementation to evaluate assertion facet on each list item is also beneficial; for example with a schema 1.1 fragment something like below:
> <xs:element name="list">
>      <xs:simpleType>
>         <xs:list>
> 	   <xs:simpleType>
> 	       <xs:restriction base="xs:integer">
> 	           <xs:assertion test="$value mod 2 = 0" />
> 	       </xs:restriction>
> 	   </xs:simpleType>
>         </xs:list>
>     </xs:simpleType>
> </xs:element>
> (the assertion failure error messages in this example would tell us, that what all list items didn't pass the test AND I believe that this run-time behavior is also useful)
> To summarize this change:
> 1. Setting the mentioned JAXP feature to 'true' would cause assertion to be evaluated only once on the entire list (which would have a type annotation xs:anyAtomicType*).
> 2. Not setting this JAXP feature explicitly (since it's default value is 'false' within Xerces XML Schema 1.1 validator), or setting explicitly it's value to 'false' would retain the current Xerces behavior as has been explained above.
> I hope that this enhancement is useful. I'll shortly be committing changes for this facility (along with related support to jaxp.SourceValidator sample). Any comments about this change would be helpful to us.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


[jira] Commented: (XERCESJ-1496) adding new feature to JAXP validator for folded simpleType->list assertions evaluation

Posted by "Mukul Gandhi (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993786#comment-12993786 ] 

Mukul Gandhi commented on XERCESJ-1496:
---------------------------------------

Hi Khaled & Michael,
   I've reverted the SVN changes made for this JIRA issue. The SVN state is now as it was before this JIRA issue was created.

I'm keeping status quo of functionality been discussed until we take a final decision about this. 

Regards,
Mukul

> adding new feature to JAXP validator for folded simpleType->list assertions evaluation
> --------------------------------------------------------------------------------------
>
>                 Key: XERCESJ-1496
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1496
>             Project: Xerces2-J
>          Issue Type: Improvement
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>            Reporter: Mukul Gandhi
>            Assignee: Mukul Gandhi
>            Priority: Minor
>
> Here's a description of the rationale and benefits of this change, and a small schema 1.1 validation use case illustrating the proposed changes.
> One of the test cases in W3C XML Schema 1.1 test suite is as follows:
> XML document [1]:
> <list>1 2 3 4 5</list>
> XML Schema 1.1 document [2]:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
>    
>     <xs:element name="list">
>          <xs:simpleType>
> 	     <xs:list>
> 	         <xs:simpleType>
> 	             <xs:restriction base="xs:integer">
> 	                 <xs:assertion test="count($value) eq count(distinct-values($value))" />
> 	             </xs:restriction>
> 	         </xs:simpleType>
> 	     </xs:list>
>          </xs:simpleType>
>     </xs:element>
>    
> </xs:schema>
> The assertion facet in this example would mean,
> "there must be no duplicates in the list"
> Xerces (before this change) didn't support an use case like above. For the above example currently Xerces evaluates assertion for each list item (therefore Xerces would make 5 calls to an assertion for this example, and the XPath 2 context variable $value being different/"list item" in each iteration) -- but this would not serve the purpose of this use case.
> I believe we must support this use case. To support this facility I propose a change along the following lines:
> We introduce a new feature on JAXP validator with name "http://apache.org/xml/features/validation/foldedSTlist-assertion-evaluation" whose default value is an boolean 'false' (therefore not setting this feature or making it explicitly 'false' would retain the current Xerces behavior). Setting this feature to 'true' would cause assertion evaluation as required by the above use case.
> The current Xerces implementation to evaluate assertion facet on each list item is also beneficial; for example with a schema 1.1 fragment something like below:
> <xs:element name="list">
>      <xs:simpleType>
>         <xs:list>
> 	   <xs:simpleType>
> 	       <xs:restriction base="xs:integer">
> 	           <xs:assertion test="$value mod 2 = 0" />
> 	       </xs:restriction>
> 	   </xs:simpleType>
>         </xs:list>
>     </xs:simpleType>
> </xs:element>
> (the assertion failure error messages in this example would tell us, that what all list items didn't pass the test AND I believe that this run-time behavior is also useful)
> To summarize this change:
> 1. Setting the mentioned JAXP feature to 'true' would cause assertion to be evaluated only once on the entire list (which would have a type annotation xs:anyAtomicType*).
> 2. Not setting this JAXP feature explicitly (since it's default value is 'false' within Xerces XML Schema 1.1 validator), or setting explicitly it's value to 'false' would retain the current Xerces behavior as has been explained above.
> I hope that this enhancement is useful. I'll shortly be committing changes for this facility (along with related support to jaxp.SourceValidator sample). Any comments about this change would be helpful to us.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


[jira] Resolved: (XERCESJ-1496) adding new feature to JAXP validator for folded simpleType->list assertions evaluation

Posted by "Mukul Gandhi (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESJ-1496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mukul Gandhi resolved XERCESJ-1496.
-----------------------------------

    Resolution: Fixed

committed changes for this enhancement and marking the issue as fixed.

> adding new feature to JAXP validator for folded simpleType->list assertions evaluation
> --------------------------------------------------------------------------------------
>
>                 Key: XERCESJ-1496
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1496
>             Project: Xerces2-J
>          Issue Type: Improvement
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>            Reporter: Mukul Gandhi
>            Assignee: Mukul Gandhi
>            Priority: Minor
>
> Here' a description of the rationale and benefits of this change, and a small schema 1.1 validation use case illustrating the proposed changes.
> One of the test cases in W3C XML Schema 1.1 test suite is as follows:
> XML document [1]:
> <list>1 2 3 4 5</list>
> XML Schema document [2]:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
>    
>     <xs:element name="list">
>          <xs:simpleType>
> 	     <xs:list>
> 	         <xs:simpleType>
> 	             <xs:restriction base="xs:integer">
> 	                 <xs:assertion test="count($value) eq count(distinct-values($value))" />
> 	             </xs:restriction>
> 	         </xs:simpleType>
> 	     </xs:list>
>          </xs:simpleType>
>     </xs:element>
>    
> </xs:schema>
> The assertion facet in this example would mean,
> "there must be no duplicates in the list"
> Xerces (before this change) didn't support an use case like above. For the above example Xerces evaluates assertion for each list item (therefore Xerces would make 5 calls to an assertion for this example, and the XPath 2 context variable $value being different/"list item" in each iteration) -- but this would not serve the purpose of this use case.
> I believe we must support this use case. To support this facility I propose a change along the following lines:
> Introduce a new feature on JAXP validator with name "http://apache.org/xml/features/validation/foldedSTlist-assertion-evaluation" whose default value is an boolean 'false' (therefore not setting this feature or making it explicitly 'false' would retain the current Xerces behavior). Setting this feature to 'true' would cause assertion evaluation as required by the above use case.
> The current Xerces implementation to evaluate assertion facet on each list item is also beneficial; for example with a schema 1.1 fragment something like below:
> <xs:element name="list">
>      <xs:simpleType>
>         <xs:list>
> 	   <xs:simpleType>
> 	       <xs:restriction base="xs:integer">
> 	           <xs:assertion test="$value mod 2 = 0" />
> 	       </xs:restriction>
> 	   </xs:simpleType>
>         </xs:list>
>     </xs:simpleType>
> </xs:element>
> (the assertion failure error messages in this example would tell us, that what all list items didn't pass the test AND I believe that this run-time behavior is also useful)
> To summarize this change:
> 1. Setting the mentioned JAXP feature to 'true' would cause assertion to be evaluated only once on the entire list (which would have a type annotation xs:anyAtomicType*).
> 2. Not setting this JAXP feature explicitly (since it's default value is 'false' within Xerces XML Schema 1.1 validator), or setting explicitly it's value to 'false' would retain the current Xerces behavior as has been explained above.
> I hope that this enhancement is useful. I'll shortly be committing changes for this facility (along with related support in jaxp.SourceValidator sample). Any comments about this change would be helpful to us.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


[jira] Commented: (XERCESJ-1496) adding new feature to JAXP validator for folded simpleType->list assertions evaluation

Posted by "Khaled Noaman (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993195#comment-12993195 ] 

Khaled Noaman commented on XERCESJ-1496:
----------------------------------------

Hi Mukul,

I am a bit confused here. Why do we need such a flag?

If we are not doing the right thing, then we just need to fix it. Why would we need to set such a flag to get the
correct behavior?

If I unserstand correctly, the asserstion on a list type apply to the whole list and not individual items. So, we should
not be having multiple asserstion evaluations (one per each item in the list).

I noticed you have already checked in some code. Would you minding backing out these changes and cheking in just
the fix for assertion evaluation?

Regards,
Khaled

> adding new feature to JAXP validator for folded simpleType->list assertions evaluation
> --------------------------------------------------------------------------------------
>
>                 Key: XERCESJ-1496
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1496
>             Project: Xerces2-J
>          Issue Type: Improvement
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>            Reporter: Mukul Gandhi
>            Assignee: Mukul Gandhi
>            Priority: Minor
>
> Here's a description of the rationale and benefits of this change, and a small schema 1.1 validation use case illustrating the proposed changes.
> One of the test cases in W3C XML Schema 1.1 test suite is as follows:
> XML document [1]:
> <list>1 2 3 4 5</list>
> XML Schema 1.1 document [2]:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
>    
>     <xs:element name="list">
>          <xs:simpleType>
> 	     <xs:list>
> 	         <xs:simpleType>
> 	             <xs:restriction base="xs:integer">
> 	                 <xs:assertion test="count($value) eq count(distinct-values($value))" />
> 	             </xs:restriction>
> 	         </xs:simpleType>
> 	     </xs:list>
>          </xs:simpleType>
>     </xs:element>
>    
> </xs:schema>
> The assertion facet in this example would mean,
> "there must be no duplicates in the list"
> Xerces (before this change) didn't support an use case like above. For the above example currently Xerces evaluates assertion for each list item (therefore Xerces would make 5 calls to an assertion for this example, and the XPath 2 context variable $value being different/"list item" in each iteration) -- but this would not serve the purpose of this use case.
> I believe we must support this use case. To support this facility I propose a change along the following lines:
> We introduce a new feature on JAXP validator with name "http://apache.org/xml/features/validation/foldedSTlist-assertion-evaluation" whose default value is an boolean 'false' (therefore not setting this feature or making it explicitly 'false' would retain the current Xerces behavior). Setting this feature to 'true' would cause assertion evaluation as required by the above use case.
> The current Xerces implementation to evaluate assertion facet on each list item is also beneficial; for example with a schema 1.1 fragment something like below:
> <xs:element name="list">
>      <xs:simpleType>
>         <xs:list>
> 	   <xs:simpleType>
> 	       <xs:restriction base="xs:integer">
> 	           <xs:assertion test="$value mod 2 = 0" />
> 	       </xs:restriction>
> 	   </xs:simpleType>
>         </xs:list>
>     </xs:simpleType>
> </xs:element>
> (the assertion failure error messages in this example would tell us, that what all list items didn't pass the test AND I believe that this run-time behavior is also useful)
> To summarize this change:
> 1. Setting the mentioned JAXP feature to 'true' would cause assertion to be evaluated only once on the entire list (which would have a type annotation xs:anyAtomicType*).
> 2. Not setting this JAXP feature explicitly (since it's default value is 'false' within Xerces XML Schema 1.1 validator), or setting explicitly it's value to 'false' would retain the current Xerces behavior as has been explained above.
> I hope that this enhancement is useful. I'll shortly be committing changes for this facility (along with related support to jaxp.SourceValidator sample). Any comments about this change would be helpful to us.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


[jira] Reopened: (XERCESJ-1496) adding new feature to JAXP validator for folded simpleType->list assertions evaluation

Posted by "Mukul Gandhi (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESJ-1496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mukul Gandhi reopened XERCESJ-1496:
-----------------------------------


reopening the JIRA issue keeping in view the objections to the implementation by fellow committers.

> adding new feature to JAXP validator for folded simpleType->list assertions evaluation
> --------------------------------------------------------------------------------------
>
>                 Key: XERCESJ-1496
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1496
>             Project: Xerces2-J
>          Issue Type: Improvement
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>            Reporter: Mukul Gandhi
>            Assignee: Mukul Gandhi
>            Priority: Minor
>
> Here's a description of the rationale and benefits of this change, and a small schema 1.1 validation use case illustrating the proposed changes.
> One of the test cases in W3C XML Schema 1.1 test suite is as follows:
> XML document [1]:
> <list>1 2 3 4 5</list>
> XML Schema 1.1 document [2]:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
>    
>     <xs:element name="list">
>          <xs:simpleType>
> 	     <xs:list>
> 	         <xs:simpleType>
> 	             <xs:restriction base="xs:integer">
> 	                 <xs:assertion test="count($value) eq count(distinct-values($value))" />
> 	             </xs:restriction>
> 	         </xs:simpleType>
> 	     </xs:list>
>          </xs:simpleType>
>     </xs:element>
>    
> </xs:schema>
> The assertion facet in this example would mean,
> "there must be no duplicates in the list"
> Xerces (before this change) didn't support an use case like above. For the above example currently Xerces evaluates assertion for each list item (therefore Xerces would make 5 calls to an assertion for this example, and the XPath 2 context variable $value being different/"list item" in each iteration) -- but this would not serve the purpose of this use case.
> I believe we must support this use case. To support this facility I propose a change along the following lines:
> We introduce a new feature on JAXP validator with name "http://apache.org/xml/features/validation/foldedSTlist-assertion-evaluation" whose default value is an boolean 'false' (therefore not setting this feature or making it explicitly 'false' would retain the current Xerces behavior). Setting this feature to 'true' would cause assertion evaluation as required by the above use case.
> The current Xerces implementation to evaluate assertion facet on each list item is also beneficial; for example with a schema 1.1 fragment something like below:
> <xs:element name="list">
>      <xs:simpleType>
>         <xs:list>
> 	   <xs:simpleType>
> 	       <xs:restriction base="xs:integer">
> 	           <xs:assertion test="$value mod 2 = 0" />
> 	       </xs:restriction>
> 	   </xs:simpleType>
>         </xs:list>
>     </xs:simpleType>
> </xs:element>
> (the assertion failure error messages in this example would tell us, that what all list items didn't pass the test AND I believe that this run-time behavior is also useful)
> To summarize this change:
> 1. Setting the mentioned JAXP feature to 'true' would cause assertion to be evaluated only once on the entire list (which would have a type annotation xs:anyAtomicType*).
> 2. Not setting this JAXP feature explicitly (since it's default value is 'false' within Xerces XML Schema 1.1 validator), or setting explicitly it's value to 'false' would retain the current Xerces behavior as has been explained above.
> I hope that this enhancement is useful. I'll shortly be committing changes for this facility (along with related support to jaxp.SourceValidator sample). Any comments about this change would be helpful to us.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


[jira] Issue Comment Edited: (XERCESJ-1496) adding new feature to JAXP validator for folded simpleType->list assertions evaluation

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993200#comment-12993200 ] 

Michael Glavassevich edited comment on XERCESJ-1496 at 2/10/11 8:11 PM:
------------------------------------------------------------------------

Mukul, it seems like the new behaviour introduced by this feature (when set to true) is a bug fix and that the current behaviour (when the feature is set to false) is a defect. It's unusual to fix a bug by introducing a new JAXP feature, especially when the default is to continue supporting the buggy behaviour. Remember that the XML Schema 1.1 spec and the implementation in Xerces are still in development. I doubt that any of our users would have a dependency on the current behaviour or an expectation that things are stable since we've clearly told them that this is experimental stuff at the moment. Can we fix the issue discovered by this W3C test cleanly and not introduce a new feature?

      was (Author: mrglavas@ca.ibm.com):
    Mukul, it seems like new behaviour introduced by this feature (when set to true) is a bug fix and that the current behaviour (when the feature is set to false) is a defect. It's unusual to fix a bug by introducing a new JAXP feature, especially when the default is to continue supporting the buggy behaviour. Remember that the XML Schema 1.1 spec and the implementation in Xerces are still in development. I doubt that any of our users would have a dependency on the current behaviour or an expectation that things are stable since we've clearly told them that this is experimental stuff at the moment. Can we fix the issue discovered by this W3C test cleanly and not introduce a new feature?
  
> adding new feature to JAXP validator for folded simpleType->list assertions evaluation
> --------------------------------------------------------------------------------------
>
>                 Key: XERCESJ-1496
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1496
>             Project: Xerces2-J
>          Issue Type: Improvement
>          Components: XML Schema 1.1 Structures
>    Affects Versions: 2.11.0
>            Reporter: Mukul Gandhi
>            Assignee: Mukul Gandhi
>            Priority: Minor
>
> Here's a description of the rationale and benefits of this change, and a small schema 1.1 validation use case illustrating the proposed changes.
> One of the test cases in W3C XML Schema 1.1 test suite is as follows:
> XML document [1]:
> <list>1 2 3 4 5</list>
> XML Schema 1.1 document [2]:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
>    
>     <xs:element name="list">
>          <xs:simpleType>
> 	     <xs:list>
> 	         <xs:simpleType>
> 	             <xs:restriction base="xs:integer">
> 	                 <xs:assertion test="count($value) eq count(distinct-values($value))" />
> 	             </xs:restriction>
> 	         </xs:simpleType>
> 	     </xs:list>
>          </xs:simpleType>
>     </xs:element>
>    
> </xs:schema>
> The assertion facet in this example would mean,
> "there must be no duplicates in the list"
> Xerces (before this change) didn't support an use case like above. For the above example currently Xerces evaluates assertion for each list item (therefore Xerces would make 5 calls to an assertion for this example, and the XPath 2 context variable $value being different/"list item" in each iteration) -- but this would not serve the purpose of this use case.
> I believe we must support this use case. To support this facility I propose a change along the following lines:
> We introduce a new feature on JAXP validator with name "http://apache.org/xml/features/validation/foldedSTlist-assertion-evaluation" whose default value is an boolean 'false' (therefore not setting this feature or making it explicitly 'false' would retain the current Xerces behavior). Setting this feature to 'true' would cause assertion evaluation as required by the above use case.
> The current Xerces implementation to evaluate assertion facet on each list item is also beneficial; for example with a schema 1.1 fragment something like below:
> <xs:element name="list">
>      <xs:simpleType>
>         <xs:list>
> 	   <xs:simpleType>
> 	       <xs:restriction base="xs:integer">
> 	           <xs:assertion test="$value mod 2 = 0" />
> 	       </xs:restriction>
> 	   </xs:simpleType>
>         </xs:list>
>     </xs:simpleType>
> </xs:element>
> (the assertion failure error messages in this example would tell us, that what all list items didn't pass the test AND I believe that this run-time behavior is also useful)
> To summarize this change:
> 1. Setting the mentioned JAXP feature to 'true' would cause assertion to be evaluated only once on the entire list (which would have a type annotation xs:anyAtomicType*).
> 2. Not setting this JAXP feature explicitly (since it's default value is 'false' within Xerces XML Schema 1.1 validator), or setting explicitly it's value to 'false' would retain the current Xerces behavior as has been explained above.
> I hope that this enhancement is useful. I'll shortly be committing changes for this facility (along with related support to jaxp.SourceValidator sample). Any comments about this change would be helpful to us.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org