World’s smallest XML XPath Tutorial

Posted on May 29, 2008. Filed under: XPath | Tags: , |

XPath is a technique that provides a way to locate and process items in XML documents by using an addressing syntax based on a path through the document’s logical structure or hierarchy.
XPath is a very important topic in XML, it has so many advantages when reading an XML file.

You can directly access a XML node [...]

Read Full Post | Make a Comment ( 1 so far )

XML with XPath in C# (handling apostrophe (‘) character)

Posted on May 27, 2008. Filed under: XML | Tags: , , , , |

The other day I was coding in C# to get a XML node based on its attributes value:
string sUser = “U1″;
XmlNode xnUser =
xmlDocument.SelectSingleNode(“tm:TM/tm:Admin/tm:User[@ID='" + sUser + "']“, TMNamespaceManager);
Now the good thing is it works in most cases but as soon as the sUser contains an apostrophe character the above code fails.
So I decided to do [...]

Read Full Post | Make a Comment ( None so far )

Liked it here?
Why not try sites on the blogroll...