Adding multiple xsd into one

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • leno
    New Member
    • Jul 2007
    • 3

    Adding multiple xsd into one

    We are in a process a combining our xsd into one master xsd. My question is it is possible? I have combined two of them into one but facing some problems when validating using XML Spy. The warning/error msg i get is :
    "
    The schema doesn't appear to be valid by itself (as a part of another schema, it might still be OK).
    Text ' - ' is not allowed for element <xsd:element> . The element declaration's content type is 'element-only'."

    Also i'm pasting my combined xsd below:

    <?xml version="1.0"?>
    <!-- $Id: IFX_IntrlXferAd d.xsd,v 1.1 2006/03/15 18:34:27 $ -->
    <!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) -->
    <!--
    : IFX_IntrlXferAd d & IFX_DepAcctStmt InqRq

    -->
    <xsd:schema xmlns:TDBN="htt p://www.&&&&&&.com/WebServices" xmlns:xsd="http ://www.w3.org/2001/XMLSchema" xmlns:IFXTDBN=" http://www.&&&&&&&.com/IFX170_TDBN" xmlns:IFX="http ://www.&&&&&&.com/IFX170_XSD" targetNamespace ="http://www.&&&&&&.com/WebServices">
    <xsd:import namespace="http ://www.&&&&&.com/IFX170_TDBN" schemaLocation= "IFX170_TDBN.xs d"/>
    <xsd:import namespace="http ://www.********.co m/IFX170_XSD" schemaLocation= "IFX170_XSD.xsd "/>
    <xsd:element name="BankSvcRq " type="IFXTDBN:B ankIntrlXferAdd Rq_Type"/>
    <xsd:element name="BankSvcRs " type="IFXTDBN:B ankIntrlXferAdd Rs_Type"/>
    <xsd:element name="BankSvcRq " type="IFXTDBN:B ankDepAcctStmtI nqRq_Type" />
    <xsd:element name="BankSvcRs " type="IFXTDBN:B ankDepAcctStmtI nqRs_Type" />
    <xsd:element name="IFX_Intrl XferAddRq">
    <xsd:annotation >
    <xsd:documentat ion> IFX Transaction Structure used for the Bank Service message Internal Funds Transfer Add Request</xsd:documentati on>
    </xsd:annotation>
    <xsd:complexTyp e>
    <xsd:sequence >
    <xsd:element ref="IFX:Signon Rq"/>
    <xsd:element ref="TDBN:BankS vcRq"/>
    <xsd:element ref="IFX:Signof fRq" minOccurs="0"/>
    </xsd:sequence>
    </xsd:complexType >
    </xsd:element>
    <xsd:element name="IFX_Intrl XferAddRs">
    <xsd:annotation >
    <xsd:documentat ion> IFX Transaction Structure used for the Bank Service message Internal Funds Transfer Add Response</xsd:documentati on>
    </xsd:annotation>
    <xsd:complexTyp e>
    <xsd:sequence >
    <xsd:element ref="IFX:Status " minOccurs="0"/>
    <xsd:element ref="IFX:Signon Rs" minOccurs="0"/>
    <xsd:element ref="TDBN:BankS vcRs"/>
    <xsd:element ref="IFX:Signof fRs" minOccurs="0"/>
    </xsd:sequence>
    </xsd:complexType >
    </xsd:element>
    <xsd:element name="IFX_DepAc ctStmtInqRq">
    - <xsd:annotation >
    <xsd:documentat ion> IFX Transaction Structure used for the Bank Service message Deposit Account Statement Inquiry Request</xsd:documentati on>
    </xsd:annotation>
    - <xsd:complexTyp e>
    - <xsd:sequence >
    <xsd:element ref="IFX:Signon Rq" />
    <xsd:element ref="TDBN:BankS vcRq" />
    <xsd:element ref="IFX:Signof fRq" minOccurs="0" />
    </xsd:sequence>
    </xsd:complexType >
    </xsd:element>
    <xsd:element name="IFX_DepAc ctStmtInqRs">
    <xsd:annotation >
    <xsd:documentat ion> IFX Transaction Structure used for the Bank Service message Deposit Account Statement Inquiry Response</xsd:documentati on>
    </xsd:annotation>
    - <xsd:complexTyp e>
    - <xsd:sequence >
    <xsd:element ref="IFX:Status " minOccurs="0" />
    <xsd:element ref="IFX:Signon Rs" minOccurs="0" />
    <xsd:element ref="TDBN:BankS vcRs" />
    <xsd:element ref="IFX:Signof fRs" minOccurs="0" />
    </xsd:sequence>
    </xsd:complexType >
    </xsd:element>
    </xsd:schema>

    Can someone please correct me if i'm missing anything? Your help and response is appreciated.

    Thanks,
    Leon
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    1. Remove the dashes that you copied from your web browser.
    2. Remove duplicate definitions:
    Code:
    	<xsd:element name="BankSvcRs" type="IFXTDBN:BankIntrlXferAddRs_Type"/>
    	<xsd:element name="BankSvcRq" type="IFXTDBN:BankDepAcctStmtInqRq_Type"/>
    3. Post the error message you get next. Can't help you further yet because you've removed your namespaces.

    Comment

    • leno
      New Member
      • Jul 2007
      • 3

      #3
      I have removed the dashes. Here is the complete copy:

      <?xml version="1.0"?>
      <!-- $Id: IFX_IntrlXferAd d.xsd,v 1.1 2006/03/15 18:34:27 snalamal Exp $ -->
      <!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by Contractor Srini (TD Banknorth) -->
      <!--
      : IFX_IntrlXferAd d & IFX_DepAcctStmt InqRq

      -->
      <xsd:schema xmlns:TDBN="htt p://www.tdbanknorth .com/WebServices" xmlns:xsd="http ://www.w3.org/2001/XMLSchema" xmlns:IFXTDBN=" http://www.tdbanknorth .com/IFX170_TDBN" xmlns:IFX="http ://www.tdbanknorth .com/IFX170_XSD" targetNamespace ="http://www.tdbanknorth .com/WebServices">
      <xsd:import namespace="http ://www.tdbanknorth .com/IFX170_TDBN" schemaLocation= "IFX170_TDBN.xs d"/>
      <xsd:import namespace="http ://www.tdbanknorth .com/IFX170_XSD" schemaLocation= "IFX170_XSD.xsd "/>
      <xsd:element name="BankSvcRq " type="IFXTDBN:B ankIntrlXferAdd Rq_Type"/>
      <xsd:element name="BankSvcRs " type="IFXTDBN:B ankIntrlXferAdd Rs_Type"/>
      <xsd:element name="BankSvcRq " type="IFXTDBN:B ankDepAcctStmtI nqRq_Type" />
      <xsd:element name="BankSvcRs " type="IFXTDBN:B ankDepAcctStmtI nqRs_Type" />
      <xsd:element name="IFX_Intrl XferAddRq">
      <xsd:annotation >
      <xsd:documentat ion>TDBanknorth 's IFX Transaction Structure used for the Bank Service message Internal Funds Transfer Add Request</xsd:documentati on>
      </xsd:annotation>
      <xsd:complexTyp e>
      <xsd:sequence >
      <xsd:element ref="IFX:Signon Rq"/>
      <xsd:element ref="TDBN:BankS vcRq"/>
      <xsd:element ref="IFX:Signof fRq" minOccurs="0"/>
      </xsd:sequence>
      </xsd:complexType >
      </xsd:element>
      <xsd:element name="IFX_Intrl XferAddRs">
      <xsd:annotation >
      <xsd:documentat ion>TDBanknorth 's IFX Transaction Structure used for the Bank Service message Internal Funds Transfer Add Response</xsd:documentati on>
      </xsd:annotation>
      <xsd:complexTyp e>
      <xsd:sequence >
      <xsd:element ref="IFX:Status " minOccurs="0"/>
      <xsd:element ref="IFX:Signon Rs" minOccurs="0"/>
      <xsd:element ref="TDBN:BankS vcRs"/>
      <xsd:element ref="IFX:Signof fRs" minOccurs="0"/>
      </xsd:sequence>
      </xsd:complexType >
      </xsd:element>
      <xsd:element name="IFX_DepAc ctStmtInqRq">
      <xsd:annotation >
      <xsd:documentat ion>TDBanknorth 's IFX Transaction Structure used for the Bank Service message Deposit Account Statement Inquiry Request</xsd:documentati on>
      </xsd:annotation>
      <xsd:complexTyp e>
      <xsd:sequence >
      <xsd:element ref="IFX:Signon Rq" />
      <xsd:element ref="TDBN:BankS vcRq" />
      <xsd:element ref="IFX:Signof fRq" minOccurs="0" />
      </xsd:sequence>
      </xsd:complexType >
      </xsd:element>
      <xsd:element name="IFX_DepAc ctStmtInqRs">
      <xsd:annotation >
      <xsd:documentat ion>TDBanknorth 's IFX Transaction Structure used for the Bank Service message Deposit Account Statement Inquiry Response</xsd:documentati on>
      </xsd:annotation>
      <xsd:complexTyp e>
      <xsd:sequence >
      <xsd:element ref="IFX:Status " minOccurs="0" />
      <xsd:element ref="IFX:Signon Rs" minOccurs="0" />
      <xsd:element ref="TDBN:BankS vcRs" />
      <xsd:element ref="IFX:Signof fRs" minOccurs="0" />
      </xsd:sequence>
      </xsd:complexType >
      </xsd:element>
      </xsd:schema>

      Now it gives me error stating:

      "'TDBN:BankSvcR q' is already declared in schema document 'C:\Documents and Settings\c-llewis\Desktop\ combined.xsd'."

      Is it possible to keep the same element name and different types? This is a combination of 2 xsd of request & response.

      Thanks!
      L

      Comment

      • jkmyoung
        Recognized Expert Top Contributor
        • Mar 2006
        • 2057

        #4
        Sorry, I asked around for ways to do this task, and Michael Kay said that it wasn't possible. There are possible workarounds, but they involve either copying the content of the 2 referenced models into one complex type, or editing the reference source.

        Comment

        Working...