Hi there,

i have a question about this. We have the same problem in our service (we do a 
syntax check of different XSD schemas)
and run into the ClassCastException as described below.
The only problem is dat we need to get this working without changing the code 
(or implementing a solution).
So, my question is, can we make changes to the XSD schema to try to avoid the 
problem in the Xerces code? Like
change definition of some elements, or arrange them in a different way.
In other word, what exactly causes these problems from the XSD point of view?

Thanks for your answer

regards,
Stef

JIRA [email protected] wrote:
> 
> 
>      [
> https://issues.apache.org/jira/browse/XERCESJ-1279?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
> ]
> 
> Arthur De Magalhaes updated XERCESJ-1279:
> -----------------------------------------
> 
>     Attachment: subXercesPatch.txt
> 
> Forgot to attach the patch.  =)
> 
>> ClassCastException in SubstitutionGroupHandler.addSubstitutionGroup()
>> during Document.normalize()
>> -------------------------------------------------------------------------------------------------
>>
>>                 Key: XERCESJ-1279
>>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1279
>>             Project: Xerces2-J
>>          Issue Type: Bug
>>          Components: XML Schema 1.0 Structures
>>    Affects Versions: 2.9.1
>>         Environment: Windows, Sun JRE 1.6.00_03
>>            Reporter: Bill Michell
>>            Assignee: Arthur De Magalhaes
>>         Attachments: ContentComponents.xsd, Crash.java, iCI.xsd,
>> subXercesPatch.txt, test.xml, test.xsd
>>
>>
>> Change 319073 introduced the class SubstitutionGroupHandler$OneSubGroup
>> and the Hashtable fSubGroupB
>> According to the documentation, the field has the following
>> characteristics:
>>     // to store substitution group information
>>     // the key to the hashtable is an element decl, and the value is
>>     // - a Vector, which contains all elements that has this element as
>> their
>>     //   substitution group affilication
>>     // - an array of OneSubGroup, which contains its substitution group
>> before block.
>> Unfortuntately, addSubstitutionGroup() contains the following line:
>>             subGroup = (Vector)fSubGroupsB.get(subHead);
>> This fails with a ClassCastException if the value for the key passed
>> turns out to be a OneSubGroup[]
>> The following lines of getSubGroupB() appear to ensure that a
>> OneSubGroup[] is in the map:
>>         // Convert to an array
>>         OneSubGroup[] ret = new OneSubGroup[newGroup.size()];
>>         for (int i = newGroup.size()-1; i >= 0; i--) {
>>             ret[i] = (OneSubGroup)newGroup.elementAt(i);
>>         }
>>         // Store the potential sub group
>>         fSubGroupsB.put(element, ret);
>>         
>>  
> 
> -- 
> 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: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 
> 
Quoted from: 
http://www.nabble.com/-jira--Created%3A-%28XERCESJ-1279%29-ClassCastException-in-SubstitutionGroupHandler.addSubstitutionGroup%28%29-during-Document.normalize%28%29-tp13611710p23733708.html


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to