Use InfoPath to Teach Yourself XPath - Hilary Stoupa
in

InfoPath Dev

Hilary Stoupa

Use InfoPath to Teach Yourself XPath

I'm working on a blog post that includes a mention of relative XPath, and rather than just continue adding info to that post (thus possibly creating the longest blog entry ever in the history of the world), I thought I'd include this tip on its own.

When I am unsure of the XPath I need for an expression, I leverage InfoPath, and you can too. Here's how:

  1. Find the field or group you need to get the relative path from:
  2. Add a rule to it - I usually add a conditional formatting rule, but since we are going to delete the rule when we are done, it really doesn't matter what type of rule you use.
  3. Create a condition - for the first drop down, select the field you need the relative path to:
  4. Change the first drop down to "The expression":
  5. VoilĂ ! You have a relative XPath!

Now you can just delete your rule. For more complex expressions, you can use the third drop down, and select "Use a formula" - and check the Edit Xpath box in the formula editor. Get in the habit at looking at the actual XPath InfoPath is using, and you'll be surprised how much XPath knowledge you pick up. 

Published May 31 2012, 09:14 AM by Hilary Stoupa
Filed under: ,

Comments

 

Hilary Stoupa said:

qRules 4.2 is coming soon, and with it - big changes to the SubmitToSharePointList command! But wait

June 28, 2012 3:56 PM

About Hilary Stoupa

I wandered into development after working as a business process analyst for a global manufacturing company. I create InfoPath solutions for our clients as well as work as a developer on company tools that extend InfoPath. I've also been instrumental in creating the InfoPath Master Class training provided by Qdabra.

Copyright © 2003-2014 Qdabra Software. All rights reserved.
View our Terms of Use.