how to sort xml data?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sakurasyi
    New Member
    • May 2006
    • 31

    how to sort xml data?

    hi there...

    i have some questions. Did anyone know how to sort a group of data in xml file? i means, i have retrieve the xml data, but it not arrange properly. For example:
    <number>
    <data1>4</data1>
    <data1>2</data1>
    <data1>5</data1>
    <data1>1</data1>
    <data1>3</data1>
    </number>

    output that i need:1,2,3,4,5

    can anyone help me, please?
  • ev951
    New Member
    • Oct 2006
    • 2

    #2
    Originally posted by sakurasyi
    hi there...

    i have some questions. Did anyone know how to sort a group of data in xml file? i means, i have retrieve the xml data, but it not arrange properly. For example:
    <number>
    <data1>4</data1>
    <data1>2</data1>
    <data1>5</data1>
    <data1>1</data1>
    <data1>3</data1>
    </number>

    output that i need:1,2,3,4,5

    can anyone help me, please?
    sakurasyi,

    If you are using an xsl file as a stylesheet for your xml file then you should try placing the code below into your xsl file. I hope this helps.

    Code:
     <xsl:sort data-type="number"/>
    Elliot

    Comment

    Working...