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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:21:56+00:00 2026-05-25T23:21:56+00:00

I would like to validate a XML file with a schema for that values

  • 0

I would like to validate a XML file with a schema for that values in the same node can’t be repeated. It’s important the order of the signatures. My invalid XML is:

   <person>
      <name>Peter Petrelli</name>
      <subject1>Mathematics</subject1>
      <note1>8.5</note1>
      <subject2>Natural Science</subject2>
      <note2>4.5</note2>
      <subject3>Mathematics</subject3>
      <note3>7</note3>
   </person>
</school>

It’s not possible Mathematics is more than once.

How can i validate this with a XSD schema?

Thank you very much

  • 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-25T23:21:57+00:00Added an answer on May 25, 2026 at 11:21 pm

    With a more sensible design there would be no problem:

    <person>
    <name>Peter Petrelli</name>
    <subject>
        <name>Mathematics</name>
        <note>2</note>
    </subject>
    <subject>
        <name>Natural Sciences</name>
        <note>2.5</note>
    </subject>
    <subject>
        <name>Mathematics</name>
        <note>4</note>
    </subject>
    

    then the <unique> definition inside the <person> element could be:

        <unique name="su">
            <selector xpath="subject" />
            <field xpath="name"/>
        </unique>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am receiving this XML file which I would like to validate. Ideally I
I would like to validate and restrict newline/linefeed character. Valid XML: <root> <node>data data</node>
I want to validate xml against xsd file. So I would like to install
For the purposes of unit testing, I would like to validate that two xml
I would like to validate a form so that it checks if the user
I would like to validate IP addresses from a list that may contain incorrectly
I would like to know how can we validate the Credit Card. We have
How can one validate an XML file using an XSD in Java? We don't
I'm trying to use the XML::LibXML::Schema to validate a xml file against a xsd.
Is it possible to validate the following xml with the following schema? I'd like

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.