Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » 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: ihc.sas-glas.mottmac.com

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
XSDComplexTypeDefinitionImpl.

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="http://www.example.com/Library"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">

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


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


Current Time: Tue Sep 24 10:34:14 GMT 2024

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

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

Back to the top