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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:32:19+00:00 2026-06-05T20:32:19+00:00

I have xml as follows <Search> <Term /> <And /> <Term /> <And />

  • 0

I have xml as follows

<Search>
    <Term />
    <And />
    <Term />
    <And />
    <Term />
</Search>

There can be n number of Terms and n-1 Ands (n > 0) in the sequence as shown. I tried the following xml schema but above xml would not get validated against the schema.
Error: cvc-complex-type.2.4.b: The content of element ‘Search’ is not complete. One of ‘{And}’ is expected.

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <xs:element name="Search">
        <xs:complexType>
            <xs:sequence>               
                <xs:sequence minOccurs="0" maxOccurs="unbounded">
                    <xs:element name="Term" type="xs:string" />
                    <xs:element name="And" type="xs:string" />
                </xs:sequence>              
                <xs:element name="Term" minOccurs="1" maxOccurs="1" type="xs:string" />             
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

Appreciate any help with the xml schema.

  • 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-05T20:32:20+00:00Added an answer on June 5, 2026 at 8:32 pm

    Reordering them like this seems to do it. Am I missing anything?

    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
        <xs:element name="Search">
            <xs:complexType>
                <xs:sequence>
                  <xs:element name="Term" minOccurs="1" maxOccurs="1" type="xs:string" />
                    <xs:sequence minOccurs="0" maxOccurs="unbounded">
                      <xs:element name="And" type="xs:string" />
                      <xs:element name="Term" type="xs:string" />
                    </xs:sequence>
                </xs:sequence>
            </xs:complexType>
        </xs:element>
    </xs:schema>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a set of XML as follows: ...<spotTerms> <terms xmlns= > <term tag=1m
Picture the following situation. I have an XML document as follows, <Form> <Control Type=Text
I have the following Python regex: xml_parse = re.search(r'^.+?<Hit_accession>(\w+?)</Hit_accession>.+?<Hsp_qseq>(\w+?)</Hsp_qseq>\s+?<Hsp_hseq>(\w+?)</Hsp_hseq>\s+?<Hsp_midline>(.+?)</Hsp_midline>',string,flags=re.DOTALL) for the following text: <?xml
I have an XML document as follows: <Database> <SMS> <Number>+447528349828</Number> <Date>09/06/24</Date> <Time>13:35:01</Time> <Message>Stop</Message> </SMS>
I have an XML schema that looks as follows: <xml> <user id=1> <first_name>Bill</first_name> <last_name>Steve</last_name>
I have an xml as follows <Students xmlns=http://AdapterTest> <Schema name=Schema1 xmlns=urn:schemas-microsoft-com:xml-data xmlns:dt=urn:schemas-microsoft-com:datatypes> <ElementType name=Student
I have an XML string as follows: <?xml version=1.0 encoding=utf-8?> <document id=0 name=RegSimple Version=0.1>
I have an XML file as follows, and I'm trying to read the content
I have an XML document as follows: <directory> <file><monitored>0</monitored> <xferStatus>1</xferStatus> <name>test1.txt</name> <size>7</size> <created>03/31/10 11:30:02
I have XML in the following form that I want to parse with PHP

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.