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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:16:28+00:00 2026-05-16T17:16:28+00:00

It is easy to define two elements with the same name like <any> in

  • 0

It is easy to define two elements with the same name like <any> in one XML schema and different permitted subelements. One should just declare two XSD types AnyType1 and AnyType2 as complexTypes which describes permitted subelements. Then one can declare element <any> in one context as <xs:element name="any" type="AnyType1" /> and as <xs:element name="any" type="AnyType2" /> in another context. My problem is that both AnyType1 and AnyType2 are recursive. To define a recursive type in XSD I use the following syntax

<xs:element name="any" type="AnyType1" />
<xs:complexType name="AnyType1">
    <xs:choice minOccurs="1" maxOccurs="unbounded">
        <!-- … some permitted subelements -->
        <xs:element name="any" type="AnyType1" />
        <!-- … some other permitted subelements -->
    </xs:choice>
</xs:complexType>

Disadvantage of this syntax is that we have to declare the element "any" on the top of schema and we can’t use <xs:element name="any" type="AnyType2" /> later to define recursive type AnyType2 somewhere later.

My question is: how to declare two recursive element types in the same XML schema in the same namespace.

The background of my question is following. I need to define XML schema which describe some tests. The tests should be combined (grouped) with respect of <all> and <any> elements (“or” and “and” operations) to describes results of some tests. In one context (in one place of XML file) I need to allow one subset of tests which can be grouped by <all> and <any> and in another place other subelements should be permitted. So I don’t want to define <anyTest1> and <anyTest2> elements or <n1:any> and <n2:any>. I want just use <any>, but if <any> is subelement of <TestBeforeProgramStart> I want allow one subset of subelements and if <any> is subelement of <TestAfterProgramEnd> another subset.

  • 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-16T17:16:29+00:00Added an answer on May 16, 2026 at 5:16 pm

    I found the answer on my question myself. It seems very simple.

    It is not need to declare <xs:element name="any" type="AnyType1" /> before <xs:complexType name="AnyType1">, so the declaration of the type AnyType1 can be just following

    <xs:complexType name="AnyType1">
        <xs:choice minOccurs="1" maxOccurs="unbounded">
            <!-- … some permitted subelements -->
            <xs:element name="any" type="AnyType1" />
            <!-- … some other permitted subelements -->
        </xs:choice>
    </xs:complexType>
    

    So the problem which I described seems not really exist.

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

Sidebar

Related Questions

If I were to define two objects myDataStore and myDrawer something like this: var
I want to formally define a schema for a JSON-based protocol. I have two
This should be an easy question. I'm new with Coq. I want to define
I have a question that really feels like I should have an easy answer
I can define church numerals fairly easy using scheme: > (define f (lambda (x)
Is there an easy way to wrap an ADODB.Connection COM object (the one defined
An easy one for anyone who knows. In TSQL Stored Procedures how do you
An easy one that I am interested in getting your thoughts on: With your
I have two copies of the same directory structure (basically, trunk and a feature
Is there an easy way (i.e. using the spaceship operator) to define comparison in

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.