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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:15:20+00:00 2026-06-18T08:15:20+00:00

I have an XML who embed the XSD, so it’s something like : <?xml

  • 0

I have an XML who embed the XSD, so it’s something like :

<?xml version="1.0" standalone="yes"?>
<NewDataSet>
  <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
      <xs:complexType>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element name="Table">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="elem1" type="xs:string" minOccurs="0" />
                <xs:element name="elem2" type="xs:string" minOccurs="0" />
                <xs:element name="elem3" type="xs:string" minOccurs="0" />
                <xs:element name="elem4" type="xs:string" minOccurs="0" />
                <xs:element name="elem5" type="xs:string" minOccurs="0" />
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:choice>
      </xs:complexType>
    </xs:element>
  </xs:schema>
  <Table>
    <elem1>random1</elem1>
    <elem2/>
    <elem3>random3</elem3>
    <elem4>random4</elem4>
    <elem5>random5</elem5>
  </Table>
</NewDataSet>

I’m currently using the a clone of the embedded XSD as Schema :

<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
  <xs:complexType>
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="Table">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="elem1" type="xs:string" minOccurs="0" />
            <xs:element name="elem2" type="xs:string" minOccurs="0" />
            <xs:element name="elem3" type="xs:string" minOccurs="0" />
            <xs:element name="elem4" type="xs:string" minOccurs="0" />
            <xs:element name="elem5" type="xs:string" minOccurs="0" />
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:choice>
  </xs:complexType>
</xs:element>

But the problem is that, when i want to unmarshal an entry XML I get the following error message :

unexpected element (uri:”http://www.w3.org/2001/XMLSchema“, local:”schema”). Expected elements are <{}Table>

I tried to add the tag on my XSD but without success, still get an error because of the namespace (i guess ?).
Any help and explanations would be really appreciate.

  • 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-18T08:15:21+00:00Added an answer on June 18, 2026 at 8:15 am

    You can leverage a StAX StreamFilter on an XMLStreamReader so that the elements corresponding to the XML schema are not reported as events. Then you can unmarshal from the XMLStreamReader with JAXB.

    • JAXB filtered parsing
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML Schema Definition file .XSD who's elements are in Spanish. I
Guys i have a xml file who contain this info: <?xml version=1.0 encoding=utf-8?> <ES>
I have a directory of large xml files with the following setup: <io:InfoObjects xmlns:crole="http://enterprise.businessobjects.com/3.0/customrole"
I have a XML like this: <thoughts> <thought> <id>1</id> <category>Leadership</category> <what>sometext</what> <who>sometext</who> </thought> <thought>
Here's the situation: I have a client who's issued me an XML schema, and
I have an XML layout that defines a TextView box 50px x 320px who
In this the catalog.xml file. I have two books who have the same inventory
I have xml like this: <rule> <word>I</word> <word>need</word> <word>more</word> <marker> <word>money</word> </marker> <word>now</word> </rule>
I have sample XML like this: <users> <user name=user1> <roles separator=,>ADM,USER</roles> </user> <user name=user2>
I have an xml document like the below one that I am trying to

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.