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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:40:15+00:00 2026-05-20T09:40:15+00:00

I have only an elementary understanding of XML Schema. This is basically my first

  • 0

I have only an elementary understanding of XML Schema. This is basically my first interaction with them in any serious way and I’m having some issues. I’ve read up on XSDs on google and everything looks on the up and up with this file.

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:element name="credits">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="property" maxOccurs="16" minOccurs="13" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="property" type="xs:string">    
    <xs:complexType>        
        <xs:sequence>            
            <xs:element ref="item" minOccurs="1" maxOccurs="unbounded" />
        </xs:sequence>
        <xs:attribute ref="name" use="required"/>
    </xs:complexType>

  </xs:element>

  <xs:element name="item" type="xs:string"/>

  <xs:attribute name="name" type="xs:string">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="example1"/>
          <xs:enumeration value="example2"/>
          <xs:enumeration value="example3"/>
          <xs:enumeration value="example4"/>
          <xs:enumeration value="example5"/>
          <xs:enumeration value="example6"/>
          <xs:enumeration value="example7"/>
          <xs:enumeration value="example8"/>
          <xs:enumeration value="example9"/>
          <xs:enumeration value="example10"/>
          <xs:enumeration value="example11"/>
          <xs:enumeration value="example12"/>
          <xs:enumeration value="example13"/>
          <xs:enumeration value="example14"/>
          <xs:enumeration value="example15"/>
          <xs:enumeration value="example16"/>
        </xs:restriction>
      </xs:simpleType>
  </xs:attribute>

</xs:schema>

Here’s how I’m loading it:

SchemaFactory schemaFactory = SchemaFactory.newInstance( XMLConstants.W3C_XML_SCHEMA_NS_URI );
Schema schemaXSD = schemaFactory.newSchema( new File ( "test.xsd" ) );

I’m getting an exception like the following:

org.xml.sax.SAXParseException:
src-element.3: Element ‘property’ has
both a ‘type’ attribute and a
‘anonymous type’ child. Only one of
these is allowed for an element.

Thanks for the help SO! Any general advice on reading/using schemas created by others is also appreciated! 😀

  • 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-20T09:40:15+00:00Added an answer on May 20, 2026 at 9:40 am

    This bit is your problem code:

    <xs:element name="property" type="xs:string">    
        <xs:complexType>        
            <xs:sequence>            
                <xs:element ref="item" minOccurs="1" maxOccurs="unbounded" />
            </xs:sequence>
            <xs:attribute ref="name" use="required"/>
        </xs:complexType>
    
      </xs:element>
    

    either remove the type on the outer element (type="xs:string"), or remove the anonymous inner complexType element (<xs:complexType> ... </xs:complexType>)

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

Sidebar

Related Questions

I am playing with phpwebsocket . Is there a way to have only one
this portion of code is outputing 01/01/1970. is my code incorrect? i have only
I have only been working with C# for a few weeks and I have
I have a problem on IE6 only. I have a page with several forms,
I've been using Capybara for integration/request testing, but have only just realised I can't
ok, this has been addressed by everybody, but yet I feel no closer to
I have a BorderContainer with some instances of spark Line. I need to select
I have a form with a mobile/cell number and a home phone number. I
I'm (I think) quite good at structuring my application classes and packages, but lately
I'm new to jQuery and PHP. I'm developing a web page to display a

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.