John R. Durant's WebLog

Blog of "The" Office Developer

Word XML and using XPath contains

I can't remember if I blogged about this, and if I did, I just don't remember (since my accident in September, my memory has been much less reliable- bummer).

Anyway, I wanted to do an XPath search for nodes that contain string1 or string2 or string3. All examples I have found for the contains() function show only one term. That's fine, but I may want to transform my raw XML to WordML under broader conditions. Well, I messed around for a while and found that it is awfully simple (Occam's razor, blah): you add an 'or' statement with the additional search term- like this:

/contacts/contact[contains(name,'Leverling') or contains(name, 'Fuller') or contains(name, 'Dodsworth')]/photo

I received this little gem yesterday: The Roku SoundBridge. I love gadgets, and this one is a dream. I need another gadget badly: a new effects pedal for my guitar- something heavy, threatening sounding.

BTW: the other day, I had a post about programmatically checking hyperlinks in Microsoft Word. There is also an ISV product that offers some pretty slick features: Link Fixer Plus. So, you can roll your own or buy a package.

 Rock Thought for the Day: Never understimate Billy Corgan's PR Savvy. He's a master at knowing how to get in the press at the right time. Yesterday, he took out full-page ads in two Chicago papers and announced on his Web site that he wants to get the Pumpkins back together. It would be a thrill for fans, and they probably will go through more drama that will be the fuel for loads of great songs.

Rock On

Published Thursday, June 23, 2005 10:46 AM by johnrdurant

Comments

 

alex said:

found your page when googling for XPath or statements. it was easier than i thought. this is what happens when you let interaction designers code...

you should get the ZVEX Fuzz Factory for your guitar. it's an insane Fuzz Pedal that gets way out there. I also recomment the Musician Sound Design PD-1 Paranoid Retro Fuzz Pedal. it a killer version of the Tony Iommi thing.
June 25, 2005 3:49 PM
Anonymous comments are disabled

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker