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 "Karthik Sankaran (JIRA)" <xe...@xml.apache.org> on 2010/04/24 15:37:49 UTC

[jira] Created: (XERCESJ-1446) Whitespace processing in union of token and string based simple types

Whitespace processing in union of token and string based simple types
---------------------------------------------------------------------

                 Key: XERCESJ-1446
                 URL: https://issues.apache.org/jira/browse/XERCESJ-1446
             Project: Xerces2-J
          Issue Type: Bug
          Components: XML Schema 1.0 Datatypes
    Affects Versions: 2.9.1
         Environment: OS: Win XP SP2
SW: Eclipse platform running Oxygen XML plugin with default validation engine Xerces-J 2.9.1
            Reporter: Karthik Sankaran
            Priority: Minor


1. "DressSizeType" is a xs:token based simple type with enumerated values "small" and "large":

    <xs:simpleType name="DressSizeType">
        <xs:restriction base="xs:token">
            <xs:enumeration value="small"/>
            <xs:enumeration value="large"/>
        </xs:restriction>
    </xs:simpleType>

2.  "MDressSizeType" is a union type with the above "DressSizeType" as one of its member types and the other being a string based simple type:

    <xs:simpleType name="MDressSizeType">
        <xs:union memberTypes="DressSizeType">
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:enumeration value="medium"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:union>   
    </xs:simpleType>

"MDressSizeType" is introduced mainly to add another enumeration value "medium" to the already existing "small" and "large" enumeration values.

3. An element "dressSize" is assigned the type "MDressSizeType"

4. "dressSize.xsd" is created from 1, 2, and 3. It looks like:

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:simpleType name="DressSizeType">
        <xs:restriction base="xs:token">
            <xs:enumeration value="small"/>
            <xs:enumeration value="large"/>
        </xs:restriction>
    </xs:simpleType>
    
    <xs:simpleType name="MDressSizeType">
        <xs:union memberTypes="DressSizeType">
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:enumeration value="medium"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:union>   
    </xs:simpleType>

    <xs:element name="dressSize" type="MDressSizeType"></xs:element>

</xs:schema>

5. "dressSize.xml" is created and it looks like:
<?xml version="1.0" encoding="UTF-8"?>
<dressSize xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="dressSize.xsd">    medium    </dressSize>

6. When 5 is validated,  the value '    medium    ' (with leading and trailing white-spaces) for the "dressSize" element was expected to be invalid as the enumeration "medium" is encapsulated within a string based simple type whose whitespace facet value is preserve.

7. But the validation engine accepts the value '    medium    '  for "dressSize" element and informs that the document is valid.

Kindly note: I have made the best possible attempt to scan all the other reported bugs under this component to avoid a duplicate entry. Apologies in case I missed out to spot it.

Thanks very much in advance! Appreciate all your efforts...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Resolved: (XERCESJ-1446) Whitespace processing in union of token and string based simple types

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

Michael Glavassevich resolved XERCESJ-1446.
-------------------------------------------

    Fix Version/s: 2.10.0
       Resolution: Fixed

I've just committed a fix. See SVN rev 937739.

> Whitespace processing in union of token and string based simple types
> ---------------------------------------------------------------------
>
>                 Key: XERCESJ-1446
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1446
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.0 Datatypes
>    Affects Versions: 2.9.1
>         Environment: OS: Win XP SP2
> SW: Eclipse platform running Oxygen XML plugin with default validation engine Xerces-J 2.9.1
>            Reporter: Karthik Sankaran
>            Assignee: Michael Glavassevich
>            Priority: Minor
>             Fix For: 2.10.0
>
>         Attachments: dressSize.zip
>
>
> 1. "DressSizeType" is a xs:token based simple type with enumerated values "small" and "large":
>     <xs:simpleType name="DressSizeType">
>         <xs:restriction base="xs:token">
>             <xs:enumeration value="small"/>
>             <xs:enumeration value="large"/>
>         </xs:restriction>
>     </xs:simpleType>
> 2.  "MDressSizeType" is a union type with the above "DressSizeType" as one of its member types and the other being a string based simple type:
>     <xs:simpleType name="MDressSizeType">
>         <xs:union memberTypes="DressSizeType">
>             <xs:simpleType>
>                 <xs:restriction base="xs:string">
>                     <xs:enumeration value="medium"/>
>                 </xs:restriction>
>             </xs:simpleType>
>         </xs:union>   
>     </xs:simpleType>
> "MDressSizeType" is introduced mainly to add another enumeration value "medium" to the already existing "small" and "large" enumeration values.
> 3. An element "dressSize" is assigned the type "MDressSizeType"
> 4. "dressSize.xsd" is created from 1, 2, and 3. It looks like:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
>     <xs:simpleType name="DressSizeType">
>         <xs:restriction base="xs:token">
>             <xs:enumeration value="small"/>
>             <xs:enumeration value="large"/>
>         </xs:restriction>
>     </xs:simpleType>
>     
>     <xs:simpleType name="MDressSizeType">
>         <xs:union memberTypes="DressSizeType">
>             <xs:simpleType>
>                 <xs:restriction base="xs:string">
>                     <xs:enumeration value="medium"/>
>                 </xs:restriction>
>             </xs:simpleType>
>         </xs:union>   
>     </xs:simpleType>
>     <xs:element name="dressSize" type="MDressSizeType"></xs:element>
> </xs:schema>
> 5. "dressSize.xml" is created and it looks like:
> <?xml version="1.0" encoding="UTF-8"?>
> <dressSize xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="dressSize.xsd">    medium    </dressSize>
> 6. When 5 is validated,  the value '    medium    ' (with leading and trailing white-spaces) for the "dressSize" element was expected to be invalid as the enumeration "medium" is encapsulated within a string based simple type whose whitespace facet value is preserve.
> 7. But the validation engine accepts the value '    medium    '  for "dressSize" element and informs that the document is valid.
> Kindly note: I have made the best possible attempt to scan all the other reported bugs under this component to avoid a duplicate entry. Apologies in case I missed out to spot it.
> Thanks very much in advance! Appreciate all your efforts...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XERCESJ-1446) Whitespace processing in union of token and string based simple types

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

Mukul Gandhi commented on XERCESJ-1446:
---------------------------------------

I think, if you want a white-space preserving behavior for all the member types of the union, you must change the 'DressSizeType' to following:

<xs:simpleType name="DressSizeType"> 
     <xs:restriction base="xs:string"> 
          <xs:enumeration value="small"/> 
          <xs:enumeration value="large"/> 
      </xs:restriction> 
</xs:simpleType>

(and, I think that would solve the problem you are facing.)

This would also make, the XSD types in your schema, more consistent with each other.

Currently, you're deriving 'DressSizeType' from xs:token, which I think, forces a white-space collapse normalization behavior to text content -- so '    medium    ' validates with an enumeration value, 'medium'.  

> Whitespace processing in union of token and string based simple types
> ---------------------------------------------------------------------
>
>                 Key: XERCESJ-1446
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1446
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.0 Datatypes
>    Affects Versions: 2.9.1
>         Environment: OS: Win XP SP2
> SW: Eclipse platform running Oxygen XML plugin with default validation engine Xerces-J 2.9.1
>            Reporter: Karthik Sankaran
>            Priority: Minor
>         Attachments: dressSize.zip
>
>
> 1. "DressSizeType" is a xs:token based simple type with enumerated values "small" and "large":
>     <xs:simpleType name="DressSizeType">
>         <xs:restriction base="xs:token">
>             <xs:enumeration value="small"/>
>             <xs:enumeration value="large"/>
>         </xs:restriction>
>     </xs:simpleType>
> 2.  "MDressSizeType" is a union type with the above "DressSizeType" as one of its member types and the other being a string based simple type:
>     <xs:simpleType name="MDressSizeType">
>         <xs:union memberTypes="DressSizeType">
>             <xs:simpleType>
>                 <xs:restriction base="xs:string">
>                     <xs:enumeration value="medium"/>
>                 </xs:restriction>
>             </xs:simpleType>
>         </xs:union>   
>     </xs:simpleType>
> "MDressSizeType" is introduced mainly to add another enumeration value "medium" to the already existing "small" and "large" enumeration values.
> 3. An element "dressSize" is assigned the type "MDressSizeType"
> 4. "dressSize.xsd" is created from 1, 2, and 3. It looks like:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
>     <xs:simpleType name="DressSizeType">
>         <xs:restriction base="xs:token">
>             <xs:enumeration value="small"/>
>             <xs:enumeration value="large"/>
>         </xs:restriction>
>     </xs:simpleType>
>     
>     <xs:simpleType name="MDressSizeType">
>         <xs:union memberTypes="DressSizeType">
>             <xs:simpleType>
>                 <xs:restriction base="xs:string">
>                     <xs:enumeration value="medium"/>
>                 </xs:restriction>
>             </xs:simpleType>
>         </xs:union>   
>     </xs:simpleType>
>     <xs:element name="dressSize" type="MDressSizeType"></xs:element>
> </xs:schema>
> 5. "dressSize.xml" is created and it looks like:
> <?xml version="1.0" encoding="UTF-8"?>
> <dressSize xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="dressSize.xsd">    medium    </dressSize>
> 6. When 5 is validated,  the value '    medium    ' (with leading and trailing white-spaces) for the "dressSize" element was expected to be invalid as the enumeration "medium" is encapsulated within a string based simple type whose whitespace facet value is preserve.
> 7. But the validation engine accepts the value '    medium    '  for "dressSize" element and informs that the document is valid.
> Kindly note: I have made the best possible attempt to scan all the other reported bugs under this component to avoid a duplicate entry. Apologies in case I missed out to spot it.
> Thanks very much in advance! Appreciate all your efforts...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (XERCESJ-1446) Whitespace processing in union of token and string based simple types

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

Karthik Sankaran updated XERCESJ-1446:
--------------------------------------

    Attachment: dressSize.zip

The contents of the attached ZIP file "dressSize.zip":

1. dressSize.xsd - The XML Schema document
2. dressSize.xml - The XML document that is being validated against the above schema

> Whitespace processing in union of token and string based simple types
> ---------------------------------------------------------------------
>
>                 Key: XERCESJ-1446
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1446
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.0 Datatypes
>    Affects Versions: 2.9.1
>         Environment: OS: Win XP SP2
> SW: Eclipse platform running Oxygen XML plugin with default validation engine Xerces-J 2.9.1
>            Reporter: Karthik Sankaran
>            Priority: Minor
>         Attachments: dressSize.zip
>
>
> 1. "DressSizeType" is a xs:token based simple type with enumerated values "small" and "large":
>     <xs:simpleType name="DressSizeType">
>         <xs:restriction base="xs:token">
>             <xs:enumeration value="small"/>
>             <xs:enumeration value="large"/>
>         </xs:restriction>
>     </xs:simpleType>
> 2.  "MDressSizeType" is a union type with the above "DressSizeType" as one of its member types and the other being a string based simple type:
>     <xs:simpleType name="MDressSizeType">
>         <xs:union memberTypes="DressSizeType">
>             <xs:simpleType>
>                 <xs:restriction base="xs:string">
>                     <xs:enumeration value="medium"/>
>                 </xs:restriction>
>             </xs:simpleType>
>         </xs:union>   
>     </xs:simpleType>
> "MDressSizeType" is introduced mainly to add another enumeration value "medium" to the already existing "small" and "large" enumeration values.
> 3. An element "dressSize" is assigned the type "MDressSizeType"
> 4. "dressSize.xsd" is created from 1, 2, and 3. It looks like:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
>     <xs:simpleType name="DressSizeType">
>         <xs:restriction base="xs:token">
>             <xs:enumeration value="small"/>
>             <xs:enumeration value="large"/>
>         </xs:restriction>
>     </xs:simpleType>
>     
>     <xs:simpleType name="MDressSizeType">
>         <xs:union memberTypes="DressSizeType">
>             <xs:simpleType>
>                 <xs:restriction base="xs:string">
>                     <xs:enumeration value="medium"/>
>                 </xs:restriction>
>             </xs:simpleType>
>         </xs:union>   
>     </xs:simpleType>
>     <xs:element name="dressSize" type="MDressSizeType"></xs:element>
> </xs:schema>
> 5. "dressSize.xml" is created and it looks like:
> <?xml version="1.0" encoding="UTF-8"?>
> <dressSize xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="dressSize.xsd">    medium    </dressSize>
> 6. When 5 is validated,  the value '    medium    ' (with leading and trailing white-spaces) for the "dressSize" element was expected to be invalid as the enumeration "medium" is encapsulated within a string based simple type whose whitespace facet value is preserve.
> 7. But the validation engine accepts the value '    medium    '  for "dressSize" element and informs that the document is valid.
> Kindly note: I have made the best possible attempt to scan all the other reported bugs under this component to avoid a duplicate entry. Apologies in case I missed out to spot it.
> Thanks very much in advance! Appreciate all your efforts...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Assigned: (XERCESJ-1446) Whitespace processing in union of token and string based simple types

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

Michael Glavassevich reassigned XERCESJ-1446:
---------------------------------------------

    Assignee: Michael Glavassevich

> Whitespace processing in union of token and string based simple types
> ---------------------------------------------------------------------
>
>                 Key: XERCESJ-1446
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1446
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.0 Datatypes
>    Affects Versions: 2.9.1
>         Environment: OS: Win XP SP2
> SW: Eclipse platform running Oxygen XML plugin with default validation engine Xerces-J 2.9.1
>            Reporter: Karthik Sankaran
>            Assignee: Michael Glavassevich
>            Priority: Minor
>         Attachments: dressSize.zip
>
>
> 1. "DressSizeType" is a xs:token based simple type with enumerated values "small" and "large":
>     <xs:simpleType name="DressSizeType">
>         <xs:restriction base="xs:token">
>             <xs:enumeration value="small"/>
>             <xs:enumeration value="large"/>
>         </xs:restriction>
>     </xs:simpleType>
> 2.  "MDressSizeType" is a union type with the above "DressSizeType" as one of its member types and the other being a string based simple type:
>     <xs:simpleType name="MDressSizeType">
>         <xs:union memberTypes="DressSizeType">
>             <xs:simpleType>
>                 <xs:restriction base="xs:string">
>                     <xs:enumeration value="medium"/>
>                 </xs:restriction>
>             </xs:simpleType>
>         </xs:union>   
>     </xs:simpleType>
> "MDressSizeType" is introduced mainly to add another enumeration value "medium" to the already existing "small" and "large" enumeration values.
> 3. An element "dressSize" is assigned the type "MDressSizeType"
> 4. "dressSize.xsd" is created from 1, 2, and 3. It looks like:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
>     <xs:simpleType name="DressSizeType">
>         <xs:restriction base="xs:token">
>             <xs:enumeration value="small"/>
>             <xs:enumeration value="large"/>
>         </xs:restriction>
>     </xs:simpleType>
>     
>     <xs:simpleType name="MDressSizeType">
>         <xs:union memberTypes="DressSizeType">
>             <xs:simpleType>
>                 <xs:restriction base="xs:string">
>                     <xs:enumeration value="medium"/>
>                 </xs:restriction>
>             </xs:simpleType>
>         </xs:union>   
>     </xs:simpleType>
>     <xs:element name="dressSize" type="MDressSizeType"></xs:element>
> </xs:schema>
> 5. "dressSize.xml" is created and it looks like:
> <?xml version="1.0" encoding="UTF-8"?>
> <dressSize xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="dressSize.xsd">    medium    </dressSize>
> 6. When 5 is validated,  the value '    medium    ' (with leading and trailing white-spaces) for the "dressSize" element was expected to be invalid as the enumeration "medium" is encapsulated within a string based simple type whose whitespace facet value is preserve.
> 7. But the validation engine accepts the value '    medium    '  for "dressSize" element and informs that the document is valid.
> Kindly note: I have made the best possible attempt to scan all the other reported bugs under this component to avoid a duplicate entry. Apologies in case I missed out to spot it.
> Thanks very much in advance! Appreciate all your efforts...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XERCESJ-1446) Whitespace processing in union of token and string based simple types

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

Karthik Sankaran commented on XERCESJ-1446:
-------------------------------------------

Thank you very much, Gentlemen, for your detailed comments and swift action! Good luck.

Sincere thanks to Priscilla Walmsley for her responses on this issue outside this forum.

One interesting observation: In fact, the value I originally typed into the JIRA textbox for the element "dressSize" in step 5 and subsequently mentioned in steps 6 and 7 was '<space><space><space><space>medium<space><space><space><space>' i.e. four leading and trailing whitespaces around the value 'medium'. I just noticed that each of these groups of whitespaces have been collapsed into a single whitespace!

> Whitespace processing in union of token and string based simple types
> ---------------------------------------------------------------------
>
>                 Key: XERCESJ-1446
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1446
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.0 Datatypes
>    Affects Versions: 2.9.1
>         Environment: OS: Win XP SP2
> SW: Eclipse platform running Oxygen XML plugin with default validation engine Xerces-J 2.9.1
>            Reporter: Karthik Sankaran
>            Assignee: Michael Glavassevich
>            Priority: Minor
>             Fix For: 2.10.0
>
>         Attachments: dressSize.zip
>
>
> 1. "DressSizeType" is a xs:token based simple type with enumerated values "small" and "large":
>     <xs:simpleType name="DressSizeType">
>         <xs:restriction base="xs:token">
>             <xs:enumeration value="small"/>
>             <xs:enumeration value="large"/>
>         </xs:restriction>
>     </xs:simpleType>
> 2.  "MDressSizeType" is a union type with the above "DressSizeType" as one of its member types and the other being a string based simple type:
>     <xs:simpleType name="MDressSizeType">
>         <xs:union memberTypes="DressSizeType">
>             <xs:simpleType>
>                 <xs:restriction base="xs:string">
>                     <xs:enumeration value="medium"/>
>                 </xs:restriction>
>             </xs:simpleType>
>         </xs:union>   
>     </xs:simpleType>
> "MDressSizeType" is introduced mainly to add another enumeration value "medium" to the already existing "small" and "large" enumeration values.
> 3. An element "dressSize" is assigned the type "MDressSizeType"
> 4. "dressSize.xsd" is created from 1, 2, and 3. It looks like:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
>     <xs:simpleType name="DressSizeType">
>         <xs:restriction base="xs:token">
>             <xs:enumeration value="small"/>
>             <xs:enumeration value="large"/>
>         </xs:restriction>
>     </xs:simpleType>
>     
>     <xs:simpleType name="MDressSizeType">
>         <xs:union memberTypes="DressSizeType">
>             <xs:simpleType>
>                 <xs:restriction base="xs:string">
>                     <xs:enumeration value="medium"/>
>                 </xs:restriction>
>             </xs:simpleType>
>         </xs:union>   
>     </xs:simpleType>
>     <xs:element name="dressSize" type="MDressSizeType"></xs:element>
> </xs:schema>
> 5. "dressSize.xml" is created and it looks like:
> <?xml version="1.0" encoding="UTF-8"?>
> <dressSize xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="dressSize.xsd">    medium    </dressSize>
> 6. When 5 is validated,  the value '    medium    ' (with leading and trailing white-spaces) for the "dressSize" element was expected to be invalid as the enumeration "medium" is encapsulated within a string based simple type whose whitespace facet value is preserve.
> 7. But the validation engine accepts the value '    medium    '  for "dressSize" element and informs that the document is valid.
> Kindly note: I have made the best possible attempt to scan all the other reported bugs under this component to avoid a duplicate entry. Apologies in case I missed out to spot it.
> Thanks very much in advance! Appreciate all your efforts...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XERCESJ-1446) Whitespace processing in union of token and string based simple types

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

Michael Glavassevich commented on XERCESJ-1446:
-----------------------------------------------

Mukul, the problem is that the white-space facet from "DressSizeType" is being applied to the other member type of "MDressSizeType". The normalization routine is mutating the StringBuffer in place which changes the initial value seen by the member type validators to the collapsed value calculated by the first. This is a bug and I'm currently fixing it.

> Whitespace processing in union of token and string based simple types
> ---------------------------------------------------------------------
>
>                 Key: XERCESJ-1446
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1446
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.0 Datatypes
>    Affects Versions: 2.9.1
>         Environment: OS: Win XP SP2
> SW: Eclipse platform running Oxygen XML plugin with default validation engine Xerces-J 2.9.1
>            Reporter: Karthik Sankaran
>            Assignee: Michael Glavassevich
>            Priority: Minor
>         Attachments: dressSize.zip
>
>
> 1. "DressSizeType" is a xs:token based simple type with enumerated values "small" and "large":
>     <xs:simpleType name="DressSizeType">
>         <xs:restriction base="xs:token">
>             <xs:enumeration value="small"/>
>             <xs:enumeration value="large"/>
>         </xs:restriction>
>     </xs:simpleType>
> 2.  "MDressSizeType" is a union type with the above "DressSizeType" as one of its member types and the other being a string based simple type:
>     <xs:simpleType name="MDressSizeType">
>         <xs:union memberTypes="DressSizeType">
>             <xs:simpleType>
>                 <xs:restriction base="xs:string">
>                     <xs:enumeration value="medium"/>
>                 </xs:restriction>
>             </xs:simpleType>
>         </xs:union>   
>     </xs:simpleType>
> "MDressSizeType" is introduced mainly to add another enumeration value "medium" to the already existing "small" and "large" enumeration values.
> 3. An element "dressSize" is assigned the type "MDressSizeType"
> 4. "dressSize.xsd" is created from 1, 2, and 3. It looks like:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
>     <xs:simpleType name="DressSizeType">
>         <xs:restriction base="xs:token">
>             <xs:enumeration value="small"/>
>             <xs:enumeration value="large"/>
>         </xs:restriction>
>     </xs:simpleType>
>     
>     <xs:simpleType name="MDressSizeType">
>         <xs:union memberTypes="DressSizeType">
>             <xs:simpleType>
>                 <xs:restriction base="xs:string">
>                     <xs:enumeration value="medium"/>
>                 </xs:restriction>
>             </xs:simpleType>
>         </xs:union>   
>     </xs:simpleType>
>     <xs:element name="dressSize" type="MDressSizeType"></xs:element>
> </xs:schema>
> 5. "dressSize.xml" is created and it looks like:
> <?xml version="1.0" encoding="UTF-8"?>
> <dressSize xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="dressSize.xsd">    medium    </dressSize>
> 6. When 5 is validated,  the value '    medium    ' (with leading and trailing white-spaces) for the "dressSize" element was expected to be invalid as the enumeration "medium" is encapsulated within a string based simple type whose whitespace facet value is preserve.
> 7. But the validation engine accepts the value '    medium    '  for "dressSize" element and informs that the document is valid.
> Kindly note: I have made the best possible attempt to scan all the other reported bugs under this component to avoid a duplicate entry. Apologies in case I missed out to spot it.
> Thanks very much in advance! Appreciate all your efforts...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XERCESJ-1446) Whitespace processing in union of token and string based simple types

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

Mukul Gandhi commented on XERCESJ-1446:
---------------------------------------

Thanks, Michael for the explanation. I've verified the fix & it works fine.

Many thanks, for looking at it.

> Whitespace processing in union of token and string based simple types
> ---------------------------------------------------------------------
>
>                 Key: XERCESJ-1446
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1446
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.0 Datatypes
>    Affects Versions: 2.9.1
>         Environment: OS: Win XP SP2
> SW: Eclipse platform running Oxygen XML plugin with default validation engine Xerces-J 2.9.1
>            Reporter: Karthik Sankaran
>            Assignee: Michael Glavassevich
>            Priority: Minor
>             Fix For: 2.10.0
>
>         Attachments: dressSize.zip
>
>
> 1. "DressSizeType" is a xs:token based simple type with enumerated values "small" and "large":
>     <xs:simpleType name="DressSizeType">
>         <xs:restriction base="xs:token">
>             <xs:enumeration value="small"/>
>             <xs:enumeration value="large"/>
>         </xs:restriction>
>     </xs:simpleType>
> 2.  "MDressSizeType" is a union type with the above "DressSizeType" as one of its member types and the other being a string based simple type:
>     <xs:simpleType name="MDressSizeType">
>         <xs:union memberTypes="DressSizeType">
>             <xs:simpleType>
>                 <xs:restriction base="xs:string">
>                     <xs:enumeration value="medium"/>
>                 </xs:restriction>
>             </xs:simpleType>
>         </xs:union>   
>     </xs:simpleType>
> "MDressSizeType" is introduced mainly to add another enumeration value "medium" to the already existing "small" and "large" enumeration values.
> 3. An element "dressSize" is assigned the type "MDressSizeType"
> 4. "dressSize.xsd" is created from 1, 2, and 3. It looks like:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
>     <xs:simpleType name="DressSizeType">
>         <xs:restriction base="xs:token">
>             <xs:enumeration value="small"/>
>             <xs:enumeration value="large"/>
>         </xs:restriction>
>     </xs:simpleType>
>     
>     <xs:simpleType name="MDressSizeType">
>         <xs:union memberTypes="DressSizeType">
>             <xs:simpleType>
>                 <xs:restriction base="xs:string">
>                     <xs:enumeration value="medium"/>
>                 </xs:restriction>
>             </xs:simpleType>
>         </xs:union>   
>     </xs:simpleType>
>     <xs:element name="dressSize" type="MDressSizeType"></xs:element>
> </xs:schema>
> 5. "dressSize.xml" is created and it looks like:
> <?xml version="1.0" encoding="UTF-8"?>
> <dressSize xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="dressSize.xsd">    medium    </dressSize>
> 6. When 5 is validated,  the value '    medium    ' (with leading and trailing white-spaces) for the "dressSize" element was expected to be invalid as the enumeration "medium" is encapsulated within a string based simple type whose whitespace facet value is preserve.
> 7. But the validation engine accepts the value '    medium    '  for "dressSize" element and informs that the document is valid.
> Kindly note: I have made the best possible attempt to scan all the other reported bugs under this component to avoid a duplicate entry. Apologies in case I missed out to spot it.
> Thanks very much in advance! Appreciate all your efforts...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
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-1446) Whitespace processing in union of token and string based simple types

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

Michael Glavassevich edited comment on XERCESJ-1446 at 4/24/10 11:24 PM:
-------------------------------------------------------------------------

Mukul, the problem is that the white-space facet from "DressSizeType" is being applied to the other member type of "MDressSizeType". The normalization routine is mutating the StringBuffer in place which changes the initial value seen by the 2nd member type validator to the collapsed value calculated by the first. This is a bug and I'm currently fixing it.

      was (Author: mrglavas@ca.ibm.com):
    Mukul, the problem is that the white-space facet from "DressSizeType" is being applied to the other member type of "MDressSizeType". The normalization routine is mutating the StringBuffer in place which changes the initial value seen by the member type validators to the collapsed value calculated by the first. This is a bug and I'm currently fixing it.
  
> Whitespace processing in union of token and string based simple types
> ---------------------------------------------------------------------
>
>                 Key: XERCESJ-1446
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1446
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.0 Datatypes
>    Affects Versions: 2.9.1
>         Environment: OS: Win XP SP2
> SW: Eclipse platform running Oxygen XML plugin with default validation engine Xerces-J 2.9.1
>            Reporter: Karthik Sankaran
>            Assignee: Michael Glavassevich
>            Priority: Minor
>         Attachments: dressSize.zip
>
>
> 1. "DressSizeType" is a xs:token based simple type with enumerated values "small" and "large":
>     <xs:simpleType name="DressSizeType">
>         <xs:restriction base="xs:token">
>             <xs:enumeration value="small"/>
>             <xs:enumeration value="large"/>
>         </xs:restriction>
>     </xs:simpleType>
> 2.  "MDressSizeType" is a union type with the above "DressSizeType" as one of its member types and the other being a string based simple type:
>     <xs:simpleType name="MDressSizeType">
>         <xs:union memberTypes="DressSizeType">
>             <xs:simpleType>
>                 <xs:restriction base="xs:string">
>                     <xs:enumeration value="medium"/>
>                 </xs:restriction>
>             </xs:simpleType>
>         </xs:union>   
>     </xs:simpleType>
> "MDressSizeType" is introduced mainly to add another enumeration value "medium" to the already existing "small" and "large" enumeration values.
> 3. An element "dressSize" is assigned the type "MDressSizeType"
> 4. "dressSize.xsd" is created from 1, 2, and 3. It looks like:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
>     <xs:simpleType name="DressSizeType">
>         <xs:restriction base="xs:token">
>             <xs:enumeration value="small"/>
>             <xs:enumeration value="large"/>
>         </xs:restriction>
>     </xs:simpleType>
>     
>     <xs:simpleType name="MDressSizeType">
>         <xs:union memberTypes="DressSizeType">
>             <xs:simpleType>
>                 <xs:restriction base="xs:string">
>                     <xs:enumeration value="medium"/>
>                 </xs:restriction>
>             </xs:simpleType>
>         </xs:union>   
>     </xs:simpleType>
>     <xs:element name="dressSize" type="MDressSizeType"></xs:element>
> </xs:schema>
> 5. "dressSize.xml" is created and it looks like:
> <?xml version="1.0" encoding="UTF-8"?>
> <dressSize xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="dressSize.xsd">    medium    </dressSize>
> 6. When 5 is validated,  the value '    medium    ' (with leading and trailing white-spaces) for the "dressSize" element was expected to be invalid as the enumeration "medium" is encapsulated within a string based simple type whose whitespace facet value is preserve.
> 7. But the validation engine accepts the value '    medium    '  for "dressSize" element and informs that the document is valid.
> Kindly note: I have made the best possible attempt to scan all the other reported bugs under this component to avoid a duplicate entry. Apologies in case I missed out to spot it.
> Thanks very much in advance! Appreciate all your efforts...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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