JQuery Plugins: Callbacks and Now Triggers | Home | Resizing Your Windows XP Boot Partition in Parallels

Filed under Quick Tips on April 15, 2008 by Joel Potischman

Parameterized XPath Expressions in .NET

Escaping parameters in an XPath expression in .NET is hard. Quick, which of the following is right?

Beats the hell out of me. Maybe one works, but I'm guessing not, and I'd assume a weird search term like Hello >:-< "How're you?" would blow me up. Fortunately, I found the wonderful Mvp.Xml .NET library, which will handle the tough work of escaping for me by letting me parameterize my XPath expressions, thereby protecting me from blowups and XPath injection attacks, like a search for '|@superuser='true. I can rewrite that search as follows:

How nice is that?

Post a Comment Digg Del.icio.us

Trackback Pings (TrackBack URL for this entry)

http://www.arc90.com/cgi-bin/mt4/mt-tb.cgi/133.

Post a Comment:

JQuery Plugins: Callbacks and Now Triggers | Main | Resizing Your Windows XP Boot Partition in Parallels