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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:08:00+00:00 2026-06-16T00:08:00+00:00

I have to describe a choice between multiple region types which all contain coordinates.

  • 0

I have to describe a choice between multiple region types which all contain “coordinates”. Unfortunately it is not allowed to have multiple xsd elements with the same name – it does not matter if they are defined multiple times or just referenced to multiple times.

<xs:group name="Region">
    <xs:choice>
        <xs:group ref="tns:CircularRegion" />
        <xs:group ref="tns:RectangularRegion" />
        <xs:group ref="tns:PolygonalRegion" />
    </xs:choice>
</xs:group>

With the referenced groups:

<xs:group name="Coordinates">
    <xs:sequence>
        <xs:element name="Latitude" type="xs:integer" />
        <xs:element name="Longitude" type="xs:integer" />
    </xs:sequence>
</xs:group>
<xs:group name="CircularRegion">
    <xs:sequence>
        <xs:group ref="tns:Coordinates" />
        <xs:element name="Radius" type="xs:integer" />
    </xs:sequence>
</xs:group>
<xs:group name="RectangularRegion">
    <xs:sequence>
        <xs:group ref="tns:Coordinates" />
        <xs:group ref="tns:Coordinates" />
    </xs:sequence>
</xs:group>
<xs:group name="PolygonalRegion">
    <xs:sequence>
        <xs:group minOccurs="3" maxOccurs="12" ref="tns:Coordinates" />
    </xs:sequence>
</xs:group>

As “Latitude” and “Longitude” are referenced to multiple times, the validation process ends with an error (multiple definitions…).

Any idea how to solve this?

EDIT The error message (German) from “Liquid XML Studio 2012” validator:

Error Mehrere Definitionen des Elements ‘Psid’ verursachen ein
mehrdeutiges Inhaltsmodell. Ein Inhaltsmodell muss so gebildet werden,
dass während der Validierung einer Elementinformationssequenz das
darin direkt, indirekt oder implizit enthaltene Partikel, mit dem
versucht wird, jedes Element in der Sequenz zu validieren, wiederum
eindeutig bestimmt werden kann, ohne den Inhalt oder die Attribute
dieses Elements zu untersuchen und ohne dass beliebige Informationen
zu den Elementen im Rest der Sequenz benötigt werden.

In English (Google translate)

Error Several definitions of element Psid ’cause an ambiguous content
model. A content model must be formed such that during validation of
an element information sequence that is directly, indirectly or
implicitly contained particles that attempts to validate each element
in the sequence in turn can be uniquely determined without the content
or attributes of that item are required to investigate and without any
information about the items in the rest of the sequence.

  • 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-06-16T00:08:00+00:00Added an answer on June 16, 2026 at 12:08 am

    The problem isn’t multiple references to the Coordinates group – the problem is a violation of the Unique Particle Attribution rule (described as deterministic in the XML spec; the description there is easier to understand).

    This is because you have a choice between CircularRegion and RectangularRegion, but both begin with the same <Latitude> element (from Coordinates).
    If you imagine trying to parse an xml document that has an <Latitude> element in it, the parser can’t tell if it’s from a CircularRegion group or a RectangularRegion group just by looking at that element. (It could if it looked further ahead in the xml, but that’s not allowed by the UPA rule). It’s a specific kind of ambiguity: more than one particle (part of the schema) can be attributed to that element, so it’s not a unique particle attribution.


    The clearest solution to this is to wrap each of your choices in a unique element (e.g. <CircularRegion>, <RectangularRegion> and <PolygonalRegion>), by using complexTypes instead of groups.

    However, I get the impression that you want the XML that your XSD describes (or would describe if it were allowed). A simple way to do that is to factor-out the common prefix e.g.

    <xs:group name="Region">
      <xs:sequence>
        <xs:group ref="tns:Coordinates"/>                <!-- common prefix -->
        <xs:choice>
          <xs:element name="Radius" type="xs:integer" /> <!-- Circular      -->
          <xs:group minOccurs="1" maxOccurs="11" ref="tns:Coordinates" />
                                                         <!-- Rect and Poly -->
        </xs:choice>
      </xs:sequence>
    </xs:group>
    

    BTW: I tested your original XSD and my xsd parser (xmllint), and it worked fine, parsing xml matching each choice. It did not flag the UPA problem…. which is odd. Despite this evidence, I’m positive it does violate the UPA rule, and xmllint is at fault. Can someone confirm or refute this please?

    I also tested my solution, and it also works.

    EDIT removed the second level of ambiguity that @SebastianMauthofer pointed out in the comments.

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

Sidebar

Related Questions

I have all the parameters fixed to describe one plot including oma , mar
I have a collection of objects which describe an image-name, its size and it's
I have the following RSpec example which is passing: describe UsersController do it should
I have a describe block like this: describe Documents do subject { page }
I have the following rspec: require 'spec_helper' describe KnowledgesController do before (:each) do @knowledge
I have no idea how to describe my problem. It is the simplest way
Let me first describe my goal: I have created an object with 3 properties:
I have two models: The model NetworkObject try to describe hosts. I want to
Weird to describe but here goes. I have a table with several rows. One
Best to describe this in code... I have this public class A<T> { public

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.