Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Problem when casting a XSDTerm to a XSDElementDeclaration !!
Problem when casting a XSDTerm to a XSDElementDeclaration !! [message #594837] Fri, 22 April 2005 09:43
Eclipse UserFriend
Originally posted by: ediouf.genigraph.fr

Hi,

I have a problem when casting a XSDTerm to a XSDElementDeclaration,
a ClassCastException is launched and in tho doc a XSDElementDeclaration is
a SubInterface of XSDTerm ! I dont understand why it does not work ??

Here's a portion of my code :

XSDTerm term = particle.getTerm();
XSDElementDeclaration element = (XSDElementDeclaration) term;

and here is a copy of the stacktrace :

java.lang.ClassCastException
at com.ecitiz.xsd.parser.Xsdparser.processingAParticle(Xsdparse r.java:260)
at com.ecitiz.xsd.parser.Xsdparser.processingAParticle(Xsdparse r.java:255)
at com.ecitiz.xsd.parser.Xsdparser.processingAnElement(Xsdparse r.java:179)
at com.ecitiz.xsd.parser.Xsdparser.processingAParticle(Xsdparse r.java:261)
at com.ecitiz.xsd.parser.Xsdparser.processingAParticle(Xsdparse r.java:255)
at com.ecitiz.xsd.parser.Xsdparser.processingAnElement(Xsdparse r.java:179)
at
com.ecitiz.xsd.parser.Xsdparser.processingTheElementRoot(Xsd parser.java:152)
at com.ecitiz.xsd.parser.Xsdparser.analyzeSchema(Xsdparser.java :127)
at
com.ecitiz.xsd.parser.XsdparserTest.testAnalyzeSchema(Xsdpar serTest.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:421)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:305)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:186)


Thanks for your reply !!
Previous Topic:EStructuralFeature for the XSDSchema
Next Topic:Problem when casting a XSDTerm to a XSDElementDeclaration !!
Goto Forum:
  


Current Time: Mon Nov 24 15:34:21 GMT 2014

Powered by FUDForum. Page generated in 0.01643 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software