Jump to content

Extension from an external module in a different namespace


SpaceCowboy850

Recommended Posts

I'm doing some code generation, and for coding reasons, I want to derive from the same base type for all of my XSDs.

 

So this works:

 

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.02"> <xs:include schemaLocation="MessageBase.xsd"/> <xs:element name="ServiceRequest" type="ServiceRequestType_VersionInfo_Request"/> <xs:complexType name="ServiceRequestType_VersionInfo_Request" mixed="true"> <xs:complexContent> <xs:extension base="MessageBase">

 

<!-- insert schema definition stuff here --> </xs:extension> </xs:complexContent> </xs:complexType></xs:schema>

In another file, I have this:

 

<?xml version="1.0" encoding="UTF-8"?><!-- edited with XMLSPY v2004 rel. 3 U (http://www.xmlspy.com) by VeriFone, Inc. (VeriFone, Inc.) --><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.5"> <xs:complexType name="MessageBase"/></xs:schema>

 

But I need that first file in its own namespace. If i set a "targetNamespace" on the first file (to put it in its own namespace), then it complains it can't find the MessageBase complexType. I'm not sure what I'm doing wrong.

 

Any ideas?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...