posts - 76, comments - 26, trackbacks - 0

January 2010 Entries

Using XPath to select nodes with a missing attribute

The only thing worse than my XPath skills are my RegEx skills.  I don’t use XPath all that much these days, but today I needed to.  It took me a while to find a code sample that does this.  After a playing a bit with SnippetCompiler, I found the solution:   StringBuilder builder = new StringBuilder(); builder.AppendLine("<foo>"); builder.AppendLine("<bar baz=\"a\">1</bar>"); builder.AppendLine("<bar>2</bar>"); builder.AppendLine("<bar baz=\"b\">3</bar>"); builder.AppendLine("<bar>4</bar>"); builder.AppendLine("<bar baz=\"c\">5</bar>"); builder.AppendLine("</foo>"); XmlDocument doc = new XmlDocument(); doc.LoadXml(builder.ToString()); XmlNodeList nodes = doc.SelectNodes("//foo/bar[not(@baz)]"); if ( nodes == null ) { WL("nodes was null"); } else { foreach ( XmlNode node in nodes ) { ...

posted @ Thursday, January 14, 2010 8:05 PM | Feedback (0) | Filed Under [ cheatsheet development ]

Mix10 @ Las Vegas (March 15 – 17)

Registration is up, and I have my fingers crossed that my company will be able to send me this year.  Here’s the sessions that look interesting to me: Silverlight 4 Bootcamp (John Papa) – This might not be the best use of my time as I feel like I’ve already learned the basics of SL development, but I would like to be able to see John go soup-to-nuts with the full SL stack. Prototyping rich silverlight 4 applications with sketchflow Using Microsoft Silverlight 4 to Create Dynamic SharePoint 2010 User...

posted @ Wednesday, January 06, 2010 12:59 PM | Feedback (0) | Filed Under [ microsoft ]

Powered by: