Click here to Skip to main content
15,926,596 members
Home / Discussions / XML / XSL
   

XML / XSL

 
QuestionConverting UTF-16 to UTF-8 Pin
love4nt24-Dec-06 20:01
love4nt24-Dec-06 20:01 
AnswerRe: Converting UTF-16 to UTF-8 Pin
Michael Dunn24-Dec-06 20:32
sitebuilderMichael Dunn24-Dec-06 20:32 
Questionxsd:enumeration from XML file Pin
Andre xxxxxxx23-Dec-06 0:23
Andre xxxxxxx23-Dec-06 0:23 
AnswerRe: xsd:enumeration from XML file Pin
Stefan Troschuetz23-Dec-06 2:02
Stefan Troschuetz23-Dec-06 2:02 
QuestionXML Document Entity Replacement Pin
Leftyfarrell20-Dec-06 9:12
Leftyfarrell20-Dec-06 9:12 
AnswerRe: XML Document Entity Replacement Pin
donchev_p21-Dec-06 0:38
donchev_p21-Dec-06 0:38 
Questionsorting by absolute value in xpath Pin
Malcolm Smart18-Dec-06 23:58
Malcolm Smart18-Dec-06 23:58 
AnswerRe: sorting by absolute value in xpath Pin
Malcolm Smart19-Dec-06 2:57
Malcolm Smart19-Dec-06 2:57 
Sorted! (pardon the pun)

<br />
class myComparer : IComparer<br />
{<br />
<br />
    public int Compare(object x, object y)<br />
    {<br />
        double l1 = double.Parse(x as string); //<--is there a better way for this?<br />
        double l2 = double.Parse(y as string);<br />
        l1 = Math.Abs(l1);<br />
        l2 = Math.Abs(l2);<br />
<br />
        if (l1 < l2) return -1;<br />
        <br />
        if (l1 > l2) return 1;<br />
<br />
        return 0;<br />
    }<br />
}<br />



and then use the comparer in the xpath expression


<br />
expr.AddSort("@Value" , new myComparer())<br />



Happy to be told there is a better way...

Cheers
Questionhi, Please tell me how we can using java to read and write to XML file for a web application : ) Pin
abiisalwayshappy18-Dec-06 0:26
abiisalwayshappy18-Dec-06 0:26 
AnswerRe: hi, Please tell me how we can using java to read and write to XML file for a web application : ) Pin
George L. Jackson18-Dec-06 13:22
George L. Jackson18-Dec-06 13:22 
GeneralRe: hi, Please tell me how we can using java to read and write to XML file for a web application : ) [modified] Pin
abiisalwayshappy18-Dec-06 17:13
abiisalwayshappy18-Dec-06 17:13 
GeneralRe: hi, Please tell me how we can using java to read and write to XML file for a web application : ) Pin
George L. Jackson19-Dec-06 2:07
George L. Jackson19-Dec-06 2:07 
GeneralRe: hi, Please tell me how we can using java to read and write to XML file for a web application : ) Pin
abiisalwayshappy19-Dec-06 16:24
abiisalwayshappy19-Dec-06 16:24 
QuestionXML Schema Pin
BINOVAR17-Dec-06 17:19
BINOVAR17-Dec-06 17:19 
AnswerRe: XML Schema Pin
Stefan Troschuetz17-Dec-06 21:17
Stefan Troschuetz17-Dec-06 21:17 
GeneralRe: XML Schema Pin
BINOVAR17-Dec-06 21:34
BINOVAR17-Dec-06 21:34 
GeneralRe: XML Schema Pin
Stefan Troschuetz17-Dec-06 21:51
Stefan Troschuetz17-Dec-06 21:51 
GeneralRe: XML Schema Pin
BINOVAR17-Dec-06 22:00
BINOVAR17-Dec-06 22:00 
Questionxml read Pin
vengaqua14-Dec-06 23:40
vengaqua14-Dec-06 23:40 
AnswerRe: xml read Pin
Stefan Troschuetz15-Dec-06 0:18
Stefan Troschuetz15-Dec-06 0:18 
QuestionQuestions Related to XML DTD Pin
Rahithi13-Dec-06 16:05
Rahithi13-Dec-06 16:05 
AnswerRe: Questions Related to XML DTD Pin
DavidNohejl15-Dec-06 11:17
DavidNohejl15-Dec-06 11:17 
GeneralRe: Questions Related to XML DTD Pin
Rahithi15-Dec-06 15:30
Rahithi15-Dec-06 15:30 
AnswerRe: Questions Related to XML DTD [modified] Pin
George L. Jackson15-Dec-06 20:45
George L. Jackson15-Dec-06 20:45 
QuestionGenerate an xml file using Schema [modified] Pin
Nnabugwu13-Dec-06 2:24
Nnabugwu13-Dec-06 2:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.