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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:36:39+00:00 2026-05-15T00:36:39+00:00

I am saving a xml document object and it is saved in a xml

  • 0

I am saving a xml document object and it is saved in a xml file as shown below .

<author name="tom" book="Fun-II"/>
<author name="jack" book="Live-I"/>
<author name="pete" book="Code-I"/>
<author name="jack" book="Live-II"/>
<author name="pete" book="Code-II"/>
<author name="tom" book="Fun-I"/>

instead i want to sort the content in document object so that when i persist the object it is saved by grouping authors then book name as below:

<author name="jack" book="Live-I"/>
<author name="jack" book="Live-II"/>
<author name="pete" book="Code-I"/>
<author name="pete" book="Code-II"/>
<author name="tom" book="Fun-I"/>
<author name="tom" book="Fun-II"/>

I use apache xml beans..any ideas on how to achieve 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-05-15T00:36:40+00:00Added an answer on May 15, 2026 at 12:36 am

    XML has no sorting order, you could transform XML by using XSLT
    Something like that:

    <xsl:for-each select="author" order-by="+ name">
    <tr>
        <td><xsl:value-of select="@name"/></td>
        <td><xsl:value-of select="@book"/></td>
    </tr>
    </xsl:for-each>
    

    See also Sorting in XSLT for furhter ideas.

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

Sidebar

Related Questions

What i try to do is saving XML document to stream, modifying it and
Saving a Word 2003 document to XML and then back results in a reduced
Using MSXML4, I am creating and saving an xml file: MSXML2::IXMLDOMDocument2Ptr m_pXmlDoc; //add some
I have a large xml file that looks like this: 20120124 07:30:15.301, saving to
I am parsing a XML document with XmlDocument. When the source file contains <template>
I am saving an XMLDocument object to disk using the Save (string) function .
How to disable auto Update Maven Dependencies after saving a pom.xml in Eclipse IDE
How do I convert the XML in an XDocument to a MemoryStream, without saving
I've got a problem at saving my entity. MApping: ?xml version=1.0 encoding=utf-8 ?> <hibernate-mapping
Basically I'm trying to set the SaveFileDialog's filter like let's say to... Xml Document

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.