Click here to Skip to main content
15,911,035 members
Home / Discussions / C#
   

C#

 
GeneralRe: Tricky XPath query C# Pin
hamster13-Aug-05 8:16
hamster13-Aug-05 8:16 
QuestionCalling C# dll from VC6 MFC application.. Possible ? Pin
Thierry Maurel3-Aug-05 3:10
Thierry Maurel3-Aug-05 3:10 
AnswerRe: Calling C# dll from VC6 MFC application.. Possible ? Pin
Joel Lucsy3-Aug-05 3:58
Joel Lucsy3-Aug-05 3:58 
AnswerRe: Calling C# dll from VC6 MFC application.. Possible ? Pin
Alomgir Miah3-Aug-05 7:36
Alomgir Miah3-Aug-05 7:36 
GeneralExpandableObjectConverter problem Pin
Shane Stevens3-Aug-05 3:09
Shane Stevens3-Aug-05 3:09 
GeneralRe: ExpandableObjectConverter problem Pin
leppie3-Aug-05 6:41
leppie3-Aug-05 6:41 
GeneralPreserving comments with XmlDocument.Load Pin
LannieK3-Aug-05 2:48
LannieK3-Aug-05 2:48 
GeneralRe: Preserving comments with XmlDocument.Load Pin
Lars Niedziolka3-Aug-05 14:19
Lars Niedziolka3-Aug-05 14:19 
Hi Lannie,

XmlDocument contains all comments if you load an xml document.
But the most access functions ignore comments.

But following simple code shows message boxes with both comments:
/*
 <test>
   <!-- super tip -->
   <tip>Close a application with the cross in the right top corner of the window.</tip>
   <!-- stupid tip -->
   <tip>1+2=3</tip>
</test>
*/
string xmlstring = @"<test><!-- super tip --><tip>Close a application with the cross in the right top corner of the window.</tip><!-- stupid tip --><tip>1+2=3</tip></test>";
XmlDocument doc = new XmlDocument();
doc.LoadXml(xmlstring);
XmlNode node = doc.SelectSingleNode("/test");
for (XmlNode subnode = node.FirstChild; subnode != null; subnode = subnode.NextSibling)
{
   XmlComment comment = subnode as XmlComment;
   if (comment != null)
     MessageBox.Show(comment.Value);
}


That the XmlDocument contains all comments you see if you look at the OuterXml property of the XmlDocument or save the document in a file.

The Comment direct before a XmlElement you get with element.PreviousSibling as XmlComment.
The Comment direct behind a XmlElement you get with element.NextSibling as XmlComment.

Hope it's help

Niedzi
GeneralDataGrid need HELP Pin
zaboboa3-Aug-05 2:44
zaboboa3-Aug-05 2:44 
Generaltypecast problem Pin
Goebel3-Aug-05 0:30
Goebel3-Aug-05 0:30 
GeneralRe: typecast problem Pin
Guffa3-Aug-05 0:42
Guffa3-Aug-05 0:42 
GeneralRe: typecast problem Pin
Goebel3-Aug-05 2:15
Goebel3-Aug-05 2:15 
GeneralRe: typecast problem Pin
Goebel3-Aug-05 2:21
Goebel3-Aug-05 2:21 
GeneralRe: typecast problem Pin
Guffa3-Aug-05 5:55
Guffa3-Aug-05 5:55 
GeneralSetup surface Pin
mamudo3-Aug-05 0:16
mamudo3-Aug-05 0:16 
Generalruntime problem Pin
nidhelp2-Aug-05 22:50
nidhelp2-Aug-05 22:50 
GeneralRe: runtime problem Pin
Mohamad Al Husseiny2-Aug-05 23:18
Mohamad Al Husseiny2-Aug-05 23:18 
GeneralRe: runtime problem Pin
mav.northwind2-Aug-05 23:18
mav.northwind2-Aug-05 23:18 
GeneralRe: runtime problem Pin
Mohamad Al Husseiny2-Aug-05 23:30
Mohamad Al Husseiny2-Aug-05 23:30 
GeneralRe: runtime problem Pin
Mohamad Al Husseiny2-Aug-05 23:27
Mohamad Al Husseiny2-Aug-05 23:27 
GeneralRe: runtime problem Pin
nidhelp2-Aug-05 23:58
nidhelp2-Aug-05 23:58 
GeneralRe: runtime problem Pin
Mohamad Al Husseiny3-Aug-05 0:54
Mohamad Al Husseiny3-Aug-05 0:54 
GeneralPlease need advice.. Pin
KORCARI2-Aug-05 22:09
KORCARI2-Aug-05 22:09 
QuestionHow to change the Background Color of DateTime Picker ? Pin
pubududilena2-Aug-05 21:54
pubududilena2-Aug-05 21:54 
GeneralError in Office Programming Pin
Hovik Melkomian2-Aug-05 20:49
Hovik Melkomian2-Aug-05 20:49 

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.