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 315203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:16:12+00:00 2026-05-12T08:16:12+00:00

I am searching for the best solution of my XML schema ( XSD ).

  • 0

I am searching for the best solution of my XML schema (XSD).

I have a response:

<xs:element name="exampleCatalogResponse">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="meta" type="tns:metaType" />
            <xs:element name="data" type="tns:defaultDataType" />
        </xs:sequence>
    </xs:complexType>
</xs:element>

…the defaultDatatype:

<xs:complexType name="defaultDataType">
    <xs:sequence>
        <xs:element name="catalog">
            <xs:complexType>
                <xs:sequence maxOccurs="unbounded">
                    <xs:element name="catalogItem" type="tns:catalogItem" />
                </xs:sequence>
            </xs:complexType>
            <xs:unique name="itemIdConstraint">
                <xs:selector xpath="tns:catalogItem" />
                <xs:field xpath="tns:id" />
            </xs:unique>
        </xs:element>
    </xs:sequence>
</xs:complexType>

…and the catalogItem:

<xs:complexType name="catalogItem">
    <xs:sequence>
        <xs:element name="id" type="xs:nonNegativeInteger" />
    </xs:sequence>
</xs:complexType>

…but now there is a special item which specialize catalogItem:

<xs:complexType name="specialItem">
    <xs:complexContent>
        <xs:extension base="tns:catalogItem">
            <xs:sequence>
                <xs:element name="code" type="xs:string" />
            </xs:sequence>
        </xs:extension>
    </xs:complexContent>
</xs:complexType>

Now I need an specialized Response for my specialItem for answering the request which expects this specialItem.

How can I realise this, without writing another defaultDataType where only the type of catalogItem changes to tns:specialItem?

  • 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-12T08:16:12+00:00Added an answer on May 12, 2026 at 8:16 am

    Thank you for your tipps 13ren,

    I used the Subsumption Feature. So the default catalogItem is used everywhere also for the unique expression. And now if i use this in xml i can specify this via type.

      <tns:catalogItem xsi:type="tns:specialItem">
        <tns:id>0</tns:id>
        <tns:code>tns:code</tns:code>
      </tns:catalogItem>
      <tns:catalogItem xsi:type="tns:specialItem">
        <tns:id>1</tns:id>
        <tns:code>tns:code</tns:code>
      </tns:catalogItem>
      <tns:catalogItem>
        <tns:id>2</tns:id>
        <tns:code>tns:code</tns:code>
      </tns:catalogItem>
    

    So the last item is the default, and the two above are specialized items. this works very well for me.

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

Sidebar

Related Questions

Im searching for the best practice (or any working solution) for the following scenario:
It is known that google has best searching & indexing algorithm. The also have
I have a program that is searching a maze to find the best way
I have been searching high and low for a solution to my problem and
I am still searching for the best solution howto use a layout with a
After searching online, the best solution I've found so far is to just make
This question is more like searching for best solution. I know how to do
I'm not very familiar with C design patterns and searching for the best solution
After much searching trying to find the best solution to using an embedded DB
I have read a few articles as I was searching for a solution. They

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.