Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » unexpected differences with/without target namespace
unexpected differences with/without target namespace [message #577661] Wed, 10 September 2003 16:29
Eclipse UserFriend
Originally posted by:

I am surprised by some failures I am getting which only occur when a
targetNamespace is declared but disappear when I remove the
targetNamespace declaration.

Two examples:

1) a complex type has an attribute reference to a simple xsd:integer
attribute. XSD provides an AttributeUse with an AttributeDeclaration.

WITHOUT a target namespace declaration at the top level, the
AttributeDeclaration has as typeDefintion an XSDSimpleTypeDefinitionImpl
with name "integer", fine.

WITH a target namespace declaration at the top level, the same
typeDefiniion field is null.

See end for the schema for this example

2) an element with complex type defined within element as extending
another complex type.

WITHOUT a target namespace declaration at the top level, the
XSDElementDeclaration has as typeDefinition an

WITH a target namespace the same typeDefinition field is null.

These nulls appear to doom a call to getEClassifier to throw a
NullPointerException as discussed in a previous post.

Complete Schema for 1)
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace=""

<xsd:attribute name = "InterchangeTime" type = "xsd:integer">
<xsd:documentation>Time (minutes) between VehicleJourneys or for travelling
within/between Clusters</xsd:documentation>
<xsd:complexType name="Book">
<xsd:element name="title" type="xsd:string"/>
<xsd:element name="pages" type="xsd:int"/>
<xsd:attribute ref = "InterchangeTime" use = "required"/>

Previous Topic:HexBinary Type Validation bug
Next Topic:Ecore mapping discussion
Goto Forum:

Current Time: Sat Aug 08 01:07:41 GMT 2020

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

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

Back to the top