[prev in list] [next in list] [prev in thread] [next in thread]
List: xmlbeans-dev
Subject: RE: sorting xml data in alphabetical order
From: "Sachin Thatte" <sachin.thatte () oracle ! com>
Date: 2008-10-10 19:07:57
Message-ID: 20081010120757015.00000003452 () sthatte-us
[Download RAW message or body]
Sorting should be possible using the order by clause in Saxon Xquery.
-Sachin
-----Original Message-----
From: Jacob Danner [mailto:jacob.danner@gmail.com]
Sent: Friday, October 10, 2008 9:34 AM
To: dev@xmlbeans.apache.org; user@xmlbeans.apache.org
Subject: Re: sorting xml data in alphabetical order
Passing on the the user list since this is more of a user question.
AFAIK, xmlbeans provides no way to do this internally so you are going to need to \
manually sort the array before you set the value of country. The JDK provides \
Arrays.sort, but you can investigate using other sort routines.
HTH,
-jacobd
On Fri, Oct 10, 2008 at 8:11 AM, Rauf khan <forum.khan@gmail.com> wrote:
>
> Hi,
>
> Using the jar of the xsd i was able to create an xml file & read it.
> Now can anyone pls let me know how to sort the xml file in
> alphabetical order including the parent & its child nodes. My xml file structure is \
> like this:
> <country name="India>
> <state>Goa</state>
> <state>Rajastan</state>
> <state>Bhopal</state>
> </country>
> <country name="America">
> <state>Texas</state>
> <state>Washington</state>
> <state>Maryland</state>
> <state>Alaska</state>
> </country>
>
>
> Expected Result:
> -----------------
> <country name="America">
> <state>Alaska</state>
> <state>Maryland</state>
> <state>Texas</state>
> <state>Washington</state>
> </country>
> <country name="India>
> <state>Bhopal</state>
> <state>Goa</state>
> <state>Rajastan</state>
> </country>
>
>
> Thanks in Advance.
> Rauf Khan
>
> --
> View this message in context:
> http://www.nabble.com/sorting-xml-data-in-alphabetical-order-tp1992024
> 6p19920246.html Sent from the Xml Beans - Dev mailing list archive at
> Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: dev-help@xmlbeans.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org
Notice: This email message, together with any attachments, may contain information \
of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be \
confidential, proprietary, copyrighted and/or legally privileged, and is intended \
solely for the use of the individual or entity named in this message. If you are not \
the intended recipient, and have received this message in error, please immediately \
return this by email and then delete it.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic