IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Redefine of Schema including an import? Options · View
oraclemike
Posted: Monday, August 23, 2010 9:06:23 PM
Rank: Newbie

Joined: 8/12/2010
Posts: 8
Location: TX
Looks like XML Spy will allow this schema to validate, however I don't know how it should be represented in the background.

I have a schema with one namespace lets call it base, base does an import to schema subschema.

Both base and subschema reference libs:libschema. libschema is a set of commonly used simple and complextypes which are shared by both base and subschema.

As it happens, libschema shares the same targetnamespace as base. Therefore, subschema has to import libs:libschema, where base does an include of libschema.

Here's the crux of my issue, if I create a schema superbase which is a redefine of bs:base and imports subs:subschema, what happens to the references of libs:libschema referenced in subs:subschema?

I did some playing around and found that XMLSpy decides these two references to the same libs:libschema results in collisions. I can references the same namespace in this way.

Is this technically correct for an XML specification standpoint?

References to the same namespace can't be "merged" via a redefine + import(shares the redefine namespace as included via import within the imported namespace) in a super schema?

Regards,

Mike
K101
Posted: Wednesday, August 25, 2010 10:38:25 AM
Rank: Advanced Member

Joined: 2/27/2009
Posts: 600
Right. Importing and redefining at the same time forces construction of equally-named (i.e., duplicate) schema components. This is rationalized by XML Schema 1.0.
oraclemike
Posted: Monday, August 30, 2010 3:25:04 PM
Rank: Newbie

Joined: 8/12/2010
Posts: 8
Location: TX
GregK wrote:
Right. Importing and redefining at the same time forces construction of equally-named (i.e., duplicate) schema components. This is rationalized by XML Schema 1.0.


Let me ask the question a little differently.
It it possible to redefine elements of an imported schema?

Meaning if a schema main imports a schema libs where main is targetnamespace http://www.main.org and libs targetnamespace is http://www.libs.org then I do an redefine from schema
red-main of targetnamespace http://www.main.org.

lets say I have a complex element libselement can I do this.

<xs:complexType name = "libs:libselement">
<xs:complexContent>
<xs:extension base = "libs:libselement">
<xs:sequence>
<xs:element name="Newelmnt" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>

Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.