<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.infopathdev.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Hilary Stoupa : XPath</title><link>http://www.infopathdev.com/blogs/hilary/archive/tags/XPath/default.aspx</link><description>Tags: XPath</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Use InfoPath to Teach Yourself XPath</title><link>http://www.infopathdev.com/blogs/hilary/archive/2012/05/31/use-infopath-to-teach-yourself-xpath.aspx</link><pubDate>Thu, 31 May 2012 16:14:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:79112</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.infopathdev.com/blogs/hilary/rsscomments.aspx?PostID=79112</wfw:commentRss><comments>http://www.infopathdev.com/blogs/hilary/archive/2012/05/31/use-infopath-to-teach-yourself-xpath.aspx#comments</comments><description>&lt;p&gt;I&amp;#39;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&amp;#39;d include this tip on its own.&lt;/p&gt;
&lt;p&gt;When I am unsure of the XPath I need for an expression, I leverage InfoPath, and you can too. Here&amp;#39;s how:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;div&gt;Find the field or group you need to get the relative path from:&lt;br /&gt;&lt;img style="WIDTH:260px;HEIGHT:293px;" src="http://www.infopathdev.com/blogs/hilary/LevIP/LevIP1.png" width="260" height="293" alt="" /&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;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&amp;#39;t matter what type of rule you use.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Create a condition - for the first drop down, select the field you need the relative path to:&lt;br /&gt;&lt;img src="http://www.infopathdev.com/blogs/hilary/LevIP/LevIP2.png" alt="" /&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Change the first drop down to &amp;quot;The expression&amp;quot;:&lt;br /&gt;&lt;img src="http://www.infopathdev.com/blogs/hilary/LevIP/LevIP3.png" alt="" /&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Voilà! You have a relative XPath!&lt;br /&gt;&lt;img src="http://www.infopathdev.com/blogs/hilary/LevIP/LevIP4.png" alt="" /&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;Now you can just delete your rule. For more complex expressions, you can use the third drop down, and select&amp;nbsp;&amp;quot;Use a formula&amp;quot; - 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&amp;#39;ll be surprised how much XPath knowledge you pick up.&amp;nbsp;&lt;/p&gt;&lt;img src="http://www.infopathdev.com/aggbug.aspx?PostID=79112" width="1" height="1"&gt;</description><category domain="http://www.infopathdev.com/blogs/hilary/archive/tags/XPath/default.aspx">XPath</category><category domain="http://www.infopathdev.com/blogs/hilary/archive/tags/InfoPath/default.aspx">InfoPath</category></item><item><title>XPath Resources</title><link>http://www.infopathdev.com/blogs/hilary/archive/2012/01/19/xpath-resources.aspx</link><pubDate>Thu, 19 Jan 2012 19:21:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:74275</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.infopathdev.com/blogs/hilary/rsscomments.aspx?PostID=74275</wfw:commentRss><comments>http://www.infopathdev.com/blogs/hilary/archive/2012/01/19/xpath-resources.aspx#comments</comments><description>&lt;p&gt;InfoPath tries to help out with XPath via the UI, but sometimes to be able to accomplish complex conditions, you may need to write your own XPath.&amp;nbsp;A good knowledge of XPath is also useful for qRules commands.&lt;/p&gt;
&lt;p&gt;Here are a few online resources I like for getting comfortable with XPath:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://zvon.org/xxl/XPathTutorial/Output/examples.html"&gt;http://zvon.org/xxl/XPathTutorial/Output/examples.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.whitebeam.org/library/guide/TechNotes/xpathtestbed.rhtm"&gt;http://www.whitebeam.org/library/guide/TechNotes/xpathtestbed.rhtm&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.w3schools.com/xpath/default.asp"&gt;http://www.w3schools.com/xpath/default.asp&lt;/a&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms256086.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms256086.aspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://www.infopathdev.com/aggbug.aspx?PostID=74275" width="1" height="1"&gt;</description><category domain="http://www.infopathdev.com/blogs/hilary/archive/tags/XPath/default.aspx">XPath</category></item></channel></rss>