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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:58:48+00:00 2026-05-28T16:58:48+00:00

I got an .xsd scheme that has multiple root elements, few complex and simple

  • 0

I got an .xsd scheme that has multiple root elements, few complex and simple types, complex types refer to those root elements. I can’t generate .xml in a way i want from it because of those root elements. So i think i need to add element that will serve as the root element, and add all other elements as its children, or am i wrong?

Is there a tool that can help me create root element and refactor scheme? What i got:
enter image description here

I was thinking maybe i just need to create another xsd with 1 element and ref all elements form first xsd in it, but i don’t exactly know how to do it. Is this a good idea?

  • 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-28T16:58:49+00:00Added an answer on May 28, 2026 at 4:58 pm

    The answer to your edit is indeed, as Pangea said, NO. And that is because to ref another element (as in <xsd:element ref=”SomeElement” … />), the referenced element must be declared globally.

    Other scenario that requires global elements is the use of substitution groups. What I am trying to suggest is that it may not always be possible to refactor an XSD in a way that leaves global only the elements you want as root in instance XML.

    Which should make you think that to solve your problem, a better way might be to go after the reason why you can’t generate .xml the way you want. If you can describe a bit of that, you might get a better answer here…

    Another reason I wanted to add this answer was that I noticed the use of XML as a tag name. While it may seem OK, I can tell you that I’ve seen some pretty “big-name” applications that would simply choke with that <XML/> tag name. XML is actually “reserved”, please take a look at this section of the XML Spec. To quote: “Names beginning with the string “xml”, or with any string which would match ((‘X’|’x’) (‘M’|’m’) (‘L’|’l’)), are reserved for standardization in this or future versions of this specification.“

    Always play nice with the specs….

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

Sidebar

Related Questions

I've got few files in resources (xsd files) that i use for validating received
I got a simple XML file that I want to validate against an XSD.
I've got the following simple XSD document ( foo.xsd ): <?xml version=1.0 encoding=UTF-8?> <xsd:schema
I've got a XML Schema (xsd file) snippet bellow, in which I want the
While trying to generate classes from a xsd, i got this error: java.lang.IllegalArgumentException: Illegal
got a new blog at wordpress few days ago ( http://ghads.wordpress.com ) and I
Got a class that serializes into xml with XMLEncoder nicely with all the variables
Got some code that is not mine and its producing this warning atm: iehtmlwin.cpp(264)
I've got an XSD schema which I've generated a class for using xsd.exe, and
I have a relatively small Java library that implements a few dozen beans (no

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.