Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » NPE during schema validation
NPE during schema validation [message #587487] Tue, 25 May 2004 14:41
test is currently offline testFriend
Messages: 51
Registered: July 2009
Member
I'm putting together some testcases for an XSD based project I'm working
on when I hit a NullPointerException validating a somewhat contrived
schema. I'm not even certain that the schema is valid, but if it isn't I
would have thought that there would be a more meaningful diagnostic than
an NPE so I figured I'd raise it with you guys to see what you think.

Here's my schema:

<schema targetNamespace="http://com/schemas/ACTDIInterface"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:xsd1="http://com/schemas/ACTDIInterface">
<complexType name="CAType">
<sequence>
<element name="el1" type="xsd1:typeRef"/>
</sequence>
</complexType>
<simpleType name="typeRef">
<restriction base="string"/>
</simpleType>
<element name="CA" substitutionGroup="xsd1:CA2" abstract="false"
final="#all"/>
<element name="CA2" ref="xsd1:CA3" abstract="false" />
<element name="CA3" type="xsd1:CAType" abstract="false" />
</schema>

The problem seems to be related to element CA which has a
substitutionGroup of CA2 which in turn references CA3. This may be an
illegal scenario for all I know.

Here is the exception stack trace:

java.lang.NullPointerException
at
org.eclipse.xsd.impl.XSDElementDeclarationImpl.validate(XSDE lementDeclarationImpl.java:1016)
at
org.eclipse.xsd.impl.XSDConcreteComponentImpl.validate(XSDCo ncreteComponentImpl.java:541)
at org.eclipse.xsd.impl.XSDSchemaImpl.validate(XSDSchemaImpl.ja va:1493)
at ...



Paul.
Previous Topic:Retrieving user information
Next Topic:NPE during schema validation
Goto Forum:
  


Current Time: Fri Apr 26 19:11:14 GMT 2024

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

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

Back to the top