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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T06:26:25+00:00 2026-05-19T06:26:25+00:00

I have a strange situation that has me perplexed a bit…. I have an

  • 0

I have a strange situation that has me perplexed a bit….

I have an XML data file I am trying to validate against a schema that seems to give different results depending on the parsers used. Not sure what I am doing wrong or how to better represent the constraints in the schema so that all the parsers can properly validate the XML…. Here is a snippet of the problem portion of the Schema:

<xsd:element name="DemoValues">
<xsd:annotation>
  <xsd:documentation>Demo values for any, or all, of the demo categories defined on the GAP . A
    demo value includes a reference to the category it applies to, a value in the appropriate
    format and an optional market reference if it is for a specific market. If the market
    reference is omitted the demo value applies to the entire area serviced by the outlet. Each
    demo category may only have a single demo value within this group of demo values. However if
    the demo value is for a market, there may be a demo value per market within this group of
    demo values. </xsd:documentation>
</xsd:annotation>
<xsd:complexType>
  <xsd:sequence>
    <xsd:element name="DemoValue" type="gap:demoValueType" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>
<xsd:unique name="DemoValueConstraint">
  <xsd:annotation>
    <xsd:documentation>Constraint allows only up to one demo value for a demo category, and per
      market when a market reference exists. </xsd:documentation>
  </xsd:annotation>
  <xsd:selector xpath="gap:DemoValue"/>
  <xsd:field xpath="@demoRef"/>
  <xsd:field xpath="@marketRef|@demoRef"/>
</xsd:unique>

Here is the offending XML:

<DemoValues>
          <DemoValue demoRef="DM0" marketRef="MKT1">0.40</DemoValue>
          <DemoValue demoRef="DM1">15.00</DemoValue>
</DemoValues>

Produces this error:

Element ‘{http://www.AAAA.org/schemas/canadianTVGAP}DemoValue’, attribute ‘marketRef’: The XPath ‘@marketRef|@demoRef’ of a field of unique identity-constraint ‘{http://www.AAAA.org/schemas/canadianTVGAP}DemoValueConstraint’ evaluates to a node-set with more than one member.

Simplified Error is:
The field ‘marketRef’ is expecting at the most one value.

The intent for the xml is to allow all these combinations:

1)

 <DemoValues>
          <DemoValue demoRef="DM0" marketRef="MKT1">0.40</DemoValue>
          <DemoValue demoRef="DM1">15.00</DemoValue>
 </DemoValues>

2)

<DemoValues>
          <DemoValue demoRef="DM0" marketRef="MKT1">0.40</DemoValue>
          <DemoValue demoRef="DM0" marketRef="MKT2">0.41</DemoValue>
          <DemoValue demoRef="DM0" marketRef="MKT3">0.42</DemoValue>
          <DemoValue demoRef="DM0" marketRef="MKT4">0.43</DemoValue>
          <DemoValue demoRef="DM1">15.00</DemoValue>
</DemoValues>

3)

<DemoValues>
          <DemoValue demoRef="DM0" marketRef="MKT1">0.40</DemoValue>
          <DemoValue demoRef="DM1" marketRef="MKT1">0.41</DemoValue>
          <DemoValue demoRef="DM2" marketRef="MKT1">0.42</DemoValue>
          <DemoValue demoRef="DM3">15.00</DemoValue>
</DemoValues>

Thanks for any help!!

  • 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-19T06:26:26+00:00Added an answer on May 19, 2026 at 6:26 am

    Do you need to use field here for some other reason than to restrict the attribute list to the combinations you describe?

    An XML element can have, at most, one instance of any named attribute. This is a fact about XML, independent of schema.

    In your definition of gap:demoValueType, simply specify the two attributes by using <xsd:attribute ... />. By the look of your examples, you probably want to use use="required" on the definition of @demoref)

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

Sidebar

Related Questions

I have strange situation - when I'm trying to update model, that can contains
I have an interesting situation that has me stumped. It seems that posting appliction/json
Here's the situation: I have a bit of graphical content inside a symbol that
a noob question here. I have a very strange situation that's very puzzling to
I have a very strange situation. Basically I have code that uses a decryptor
I have this strange issue where anytime I open a XAML file that contains
I am stuck onto a very strange situation. I have a workflow that i
I have a strange situation in regards to xml serialization... If I run MyApp.exe
I have a very strange situation. I have a large set of records to
I have a strange, sporadic issue. I have stored procedure that returns back 5

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.