Click here to Skip to main content
15,895,746 members
Home / Discussions / C#
   

C#

 
GeneralRe: Edit a file Pin
Heath Stewart17-May-04 3:47
protectorHeath Stewart17-May-04 3:47 
GeneralImage Transparent In C# Pin
Anonymous17-May-04 2:44
Anonymous17-May-04 2:44 
GeneralRe: Image Transparent In C# Pin
Heath Stewart17-May-04 3:49
protectorHeath Stewart17-May-04 3:49 
GeneralGetting the Attibute on an element XML Pin
Melanius17-May-04 1:27
Melanius17-May-04 1:27 
GeneralRe: Getting the Attibute on an element XML Pin
Heath Stewart17-May-04 3:54
protectorHeath Stewart17-May-04 3:54 
GeneralSlow sorting with XSL Pin
bertcox17-May-04 0:18
bertcox17-May-04 0:18 
GeneralRe: Slow sorting with XSL Pin
Dave Kreskowiak17-May-04 3:39
mveDave Kreskowiak17-May-04 3:39 
GeneralRe: Slow sorting with XSL Pin
Appelz17-May-04 3:44
Appelz17-May-04 3:44 
Hi,

i did it like this:


private void SortXml(string sortOrder, string sortString)
{
xml.Load(filePath);
string pad = "//session[@name='" + cboSessions.SelectedItem.ToString() + "']";
XmlNodeList selectedNode = xml.SelectNodes(pad);

string box = selectedNode.Item(0).OuterXml;
xml.LoadXml(box);
XmlTextWriter xmltw = new XmlTextWriter(hulpfilePath,new UTF8Encoding(false));
xml.WriteTo(xmltw);
xmltw.Close();

string xsl = "<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">"
+ "<xsl:template match=\"@*|node()\">"
+ "<xsl:copy>"
+ " <xsl:apply-templates select=\"@*|node()\">"
+ "<xsl:sort data-type=\"number\"" + " select=\""+ sortString +"\"" + " order=\"" + sortOrder + "\"" + "/>"
+ "</xsl:apply-templates>"
+ "</xsl:copy>"
+ "</xsl:template>"
+ "</xsl:stylesheet>";

XslTransform xslt = new XslTransform();
StringReader rdr = new StringReader(xsl);
xslt.Load(new XPathDocument(rdr), null,null);
xslt.Transform(hulpfilePath,hulpfilePath,null);

ds.Clear();
ds.ReadXml(hulpfilePath);
File.Delete(hulpfilePath);
}
GeneralRe: Slow sorting with XSL Pin
Dave Kreskowiak17-May-04 6:28
mveDave Kreskowiak17-May-04 6:28 
GeneralRe: Slow sorting with XSL Pin
bertcox17-May-04 3:55
bertcox17-May-04 3:55 
GeneralOpenfiledialog Pin
bertcox16-May-04 22:28
bertcox16-May-04 22:28 
GeneralRe: Openfiledialog Pin
sreejith ss nair17-May-04 1:40
sreejith ss nair17-May-04 1:40 
GeneralRe: Openfiledialog Pin
Heath Stewart17-May-04 3:58
protectorHeath Stewart17-May-04 3:58 
GeneralRe: Openfiledialog Pin
bertcox17-May-04 4:12
bertcox17-May-04 4:12 
Generalregd dll's Pin
karteek16-May-04 21:43
karteek16-May-04 21:43 
GeneralRe: regd dll's Pin
wibblewibblewibble16-May-04 22:14
wibblewibblewibble16-May-04 22:14 
GeneralRe: regd dll's Pin
Dave Kreskowiak17-May-04 0:50
mveDave Kreskowiak17-May-04 0:50 
GeneralInterProcess Communication in WinForms Pin
Ariadne16-May-04 21:39
Ariadne16-May-04 21:39 
GeneralRe: InterProcess Communication in WinForms Pin
Dave Kreskowiak17-May-04 3:34
mveDave Kreskowiak17-May-04 3:34 
GeneralRe: InterProcess Communication in WinForms Pin
Ariadne17-May-04 3:37
Ariadne17-May-04 3:37 
GeneralRe: InterProcess Communication in WinForms Pin
Dave Kreskowiak17-May-04 3:45
mveDave Kreskowiak17-May-04 3:45 
GeneralRe: InterProcess Communication in WinForms Pin
Ariadne17-May-04 4:04
Ariadne17-May-04 4:04 
GeneralRe: InterProcess Communication in WinForms Pin
Dave Kreskowiak17-May-04 4:26
mveDave Kreskowiak17-May-04 4:26 
GeneralRe: InterProcess Communication in WinForms Pin
Ariadne17-May-04 4:38
Ariadne17-May-04 4:38 
GeneralRe: InterProcess Communication in WinForms Pin
Dave Kreskowiak17-May-04 4:55
mveDave Kreskowiak17-May-04 4:55 

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.