Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
2.12.0
-
None
-
None
Description
Hi all,
I consume XSCMValidator API to manage completion in XML editor based on XML Schema by taking care of existing XML elements and filter available elements according XML Schema constraints.
It works great except whis xs:all in XSD 1.1 and maxOccurs="unbound"
For instance if I have this xs:all:
------------------------------------------------------------
<xs:all>
<xs:element name="testEle" minOccurs="1" maxOccurs="unbounded" type="xs:string"/>
<xs:element name="testEleTwo" type="xs:string"/>
</xs:all>
------------------------------------------------------------
and I have this XML file:
------------------------------------------------------------
<t:testEle>A</t:testEle>
<t:testEle>B</t:testEle>
<t:testEleTwo>C</t:testEleTwo>
------------------------------------------------------------
If I open completion on | (after the 2 t:testEle, I would like to have
* t:testEle
* t:testEleTwo
but I have only:
* t:testEleTwo
After debugging Xerces, it appears that you don't take care of "unbound" in the XS11AllCM#whatCanGoHere.
You do this test:
------------------------------------------------------------
if (state[i] == STATE_START || state[i] < fMaxOccurs[i]) {
------------------------------------------------------------
although I think test should be:
------------------------------------------------------------
if (state[i] == STATE_START || state[i] < fMaxOccurs[i] || fMaxOccurs[i] == SchemaSymbols.OCCURRENCE_UNBOUNDED) {
------------------------------------------------------------
This errors occurs in the following code:
It seems this bug doesn't affect validation since in this case XS11AllCM#whatCanGoHere is never called.
Many thank's for your help.
Regard's Angelo