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

  • Home
  • SEARCH
  • 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 3495590
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:08:42+00:00 2026-05-18T12:08:42+00:00

I have an XML with following format. <RootNode> <Parent> <Child1>Some text about child 1</Child1>

  • 0

I have an XML with following format.

<RootNode>
    <Parent>
        <Child1>Some text about child 1</Child1>
        <Child2>Some text about child 2</Child2>
        ....
        ....
        <Child5>Some text about child 5</Child5>
        ....
        ....
        <Childn>Some text about child n</Childn>
    </Parent>
</RootNode>

Now I want to validate this xml against xsd.

But the problem is the number and node name of children are not fixed.

Please check following samples of my file

Sample 1: Two children with node name Child1 and Child2

<RootNode>
    <Parent>
        <Child1>Some text about child 1</Child1>
        <Child2>Some text about child 2</Child2>
    </Parent>
</RootNode>

Sample 2: Three children with node name Child4 Child5, and Child8

<RootNode>
    <Parent>
        <Child4>Some text about child 4</Child4>
        <Child5>Some text about child 5</Child4>
        <Child8>Some text about child 8</Child8>
    </Parent>
</RootNode>

I want a to validate the text inside the Child node (which is shown as “Some text about child n”) with following rule

Rule: The xml is invalid if any Child node – (Children of Parent) has iner text length more then 256.

It means consider the xml invalid if any child of the “Parent” node has inner text longer then 256 characters

Is this possible using XSD schema validation? Could you please help me creating .XSD file to validate this?

Thanks in advance

  • 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-18T12:08:43+00:00Added an answer on May 18, 2026 at 12:08 pm

    You can’t solve that with XSD as said before simply because you don’t know what all the element names will be in advance. If you are not totally tied to XSD validation you may wish to take a look at Schematron which can do exactly this sort of validation.

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

Sidebar

Related Questions

I have an xml in the following format <root> <page> <title>text</title> <text attrib1=1>some text</text>
So I have some XML in the following format: <somenode> <html xmlns=http://www.w3.org/1999/xhtml> <head> <title/>
I have some xml in the following format: <fileExport> <rows> <row id=0> <columns> <column
I have XML in the following format which I want to reformat: <blocks> <!--
I have XML in the following format: <Products> <Product name=MyProduct1> <Components> <Component name=MyComponent1> <Teams>
I have an XML file which is in the following format: <root> <category> <doctype>
I have a xml database with the following format: <Students> <Student ID= *GUID NUMBER*>
I have an xml document with the following format: <response username=123 customerName=CustomerName siteName=SiteName customerID=123
I have an XML file in the following format: <doc> <id name=X> <type name=A>
I have the following XML format and would like to get the list of

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.