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