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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:30:03+00:00 2026-06-04T16:30:03+00:00

I’m writing an XML schema for the first time and I found some usefull

  • 0

I’m writing an XML schema for the first time and I found some usefull tools to help me writing it.

Now I’m in a strange situation. The schema I wrote is valid for some tools and not for some others.
This schema is a mix of "all", "sequence" and "group". Here is my XML schema:

<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
     <xsd:group name="test">

        <xsd:all>
                <xsd:element name="e2" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="e3" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="e4" minOccurs="0" maxOccurs="1"/>
        </xsd:all>
    </xsd:group>

    <xsd:element name="e0">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="e1" maxOccurs="unbounded"/>
                <xsd:group ref="test"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
</xsd:schema>

Is this schema right?
It goes right with this validator and this one too but the XML Tools plugin for Notepad++ says "Unable to parse schema file".

P.S: I wrote this schema because I wanted to have an element "e0" with this the possibility to have a mix of e1, e2, e3 and e4. e2, e3 and e4 should appear 0 or 1 time and e1 could occurs an illimited times.
For example this XML files should pass:

<e0>
   <e1/>
   <e1/>
   <e1/>
   <e1/>
   <e1/>
   <e2/>
</e0>

<e0>
   <e2/>
   <e3/>
   <e4/>
</e0>

<e0>
   <e1/>
   <e2/>
   <e3/>
   <e4/>
</e0>

Do you know an other way to do this?

Thanks

  • 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-04T16:30:05+00:00Added an answer on June 4, 2026 at 4:30 pm

    The schema you have seems to be invalid according to the 1.0 version which states plainly here (Primer) that

    XML Schema stipulates that an all group must appear as the sole child at the top of a content model.

    Alternatively, try to read section 3.8.6 of the XML Schema Structures here. To your list I would add .NET’s XSD processor, which in your case will complain as:

    The group ref to 'all' is not the root particle, or it is being used as an extension.

    With XSD 1.0 there is no solution that would give you what you want nicely and with a concised syntax unless you build a wrapper for e1 elements (below as e1s).

    <?xml version="1.0" encoding="utf-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <xsd:group name="test">
            <xsd:all>
                <xsd:element name="e1s" minOccurs="0">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="e1" maxOccurs="unbounded"/>
                        </xsd:sequence>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element name="e2" minOccurs="0"/>
                <xsd:element name="e3" minOccurs="0"/>
                <xsd:element name="e4" minOccurs="0"/>
            </xsd:all>
        </xsd:group>
        <xsd:element name="e0">
            <xsd:complexType>
                <xsd:group ref="test"/>
            </xsd:complexType>
        </xsd:element>
    </xsd:schema> 
    

    When it comes to e1 elements, they must be wrapped in e1s

    <e0>
        <e1s>
            <e1/>
            <e1/>
            <e1/>
            <e1/>
            <e1/>
        </e1s>
        <e2/>
    </e0>  
    

    or

    <e0>
        <e1s>
            <e1/>
        </e1s>
        <e2/>
        <e3/>
        <e4/>
    </e0>     
    

    Then it’ll all validate…

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

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.