Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 418483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:40:59+00:00 2026-05-12T18:40:59+00:00

I have an xsd which has 3 imports to another xsd, 8 complex types

  • 0

I have an xsd which has 3 imports to another xsd, 8 complex types and 3 simple types.

Now of this I have to work on only 1 compex type, which in turn inherits many other XSD – mainly the 3 imports which current xsd’s has.

I will be getting XML file containing data only according to 1 complex type only, which I have mentioned.

Now am trying to generate sample XML file which contains data according to single complex type and am trying to validate it, but when I try to do so using XMLSpy or OxygenXML it says that root node is not defined.

Now, when I try to define root nodes it does not allow me to do so and if I try to create another xsd just for this complex type than also it gives me some errors as inherited xsd which this complex type points to in initial xsd is not working in new one, I tried to inherit 3 xsd’s to which complex type point to in initial xsd in new xsd but still it is not working.

Also my another question is – Can we validate XML file against some part of XSD as compared to complete XSD because XML what am getting is according to 1 complex element type in XSD ?

Format of Initial XSD:

 <?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:schema location targetNamespace=targetnamespace elementFormDefault="qualified" attributeFormDefault="unqualified" version="0.652">
    <xs:import namespace=first xsd which is imported>
    <xs:import namespace=second xsd which is imported>
    <xs:import namespace=third xsd which is imported>
    <xs:complexType name="firstcomplextype" abstract="false">
        <xs:sequence>
            <xs:element name="some value" type="xs:string" minOccurs="0"/>
            <xs:element name="some value" type="some value"/>
            <xs:element name="some value" type="xs:string" minOccurs="0"/>
        </xs:sequence>
        <xs:attribute name="some value" type="xs:int" use="required"/>
        <xs:attribute name="some value" type="xs:value" use="required"/>
        <xs:attribute name="some value" type="xs:int" use="required"/>
    </xs:complexType>
    <xs:complexType name="second complex type" abstract="false">
        <xs:sequence>
            <xs:element name="some value" type="xs:some value" minOccurs="0"/>
            <xs:element name="some value" type="xs:some value" minOccurs="0"/>
            <xs:element name="some value" type="some value"/>
            <xs:element name="some value" type="some value"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="third complex type**I need to work with only this complex type and xml file will contain data according to this complex type only and I need to validate incoming XML against only this complex type**" abstract="false">
        <xs:sequence>
            <xs:element name="some value" minOccurs="0">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="some value" type="some value" minOccurs="0" maxOccurs="unbounded"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="some value" type="some value"/>
            <xs:element name="some value" minOccurs="0">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="some value" type="some value" minOccurs="0" maxOccurs="unbounded"/>---**Here this particular element points to another XSD, one of the imported XSD's**
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:sequence minOccurs="0">
                <xs:element name="some value" type="xs:some value" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element name="some value" minOccurs="0">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="some value" type="some value" minOccurs="0" maxOccurs="unbounded"/>---**Here this particular element points to another XSD, one of the imported XSD's**
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
            <xs:sequence minOccurs="0">
                <xs:element name="some value" type="xs:some value" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element name="some value" minOccurs="0">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="some value" type="some value" minOccurs="0" maxOccurs="unbounded"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="4th complex type" abstract="false">
        <xs:sequence>
            <xs:element name="elements">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="some value" type="some value" maxOccurs="unbounded"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

and the xsd continues as it has many more complex types and simple types. Any guidance would be highly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T18:40:59+00:00Added an answer on May 12, 2026 at 6:40 pm

    The schema file you posted shows only complexType definitions. To validate an XML document, you should have an element declaration at the top level that matches the document’s root element. If your schema (or one of the imported schemas) has such, please post that part and also a short XML document that you’re trying to validate.

    There is no problem with validating against a “part” of a schema. Any element declaration at the top level can serve as the root element of a validated XML document, as XML Schema has no concept of defining the root element (unlike DTD and RELAX NG, which are more document-oriented).

    If you have control over your XML documents, you could also try attaching an xsi:type attribute to your root element to indicate the complexType you wish to validate against. So you would add something like

    xsi:type="firstcomplextype" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    

    in the attributes of the root element of your XML document.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have a lot of complex-types in xsd, which for example has some
I have this in some WSDL: <element name="startDate" type="xsd:dateTime"/> <element name="endDate" type="xsd:dateTime"/> Which results
It seems I can't easily have an XSD declaration for this simple XML <root>
For example, I've got a simple schema which imports another schema. The second schema
I have an XSD schema with target namespace ns1 which defines the following type:
I have the following xml which has xsd schema, but is poor and no
I have a simple XML file here which I converted to XSD with xsd.exe
I have an XSD which was transformed from a RELAX NG schema with a
I have an XSD file which is used to generate some objects which are
I have an xsd that looks like this (snippet): <xs:complexType name=IDType> <xs:choice minOccurs=1 maxOccurs=2>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.