Jump to content

Extension from an external module in a different namespace

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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...