Data Source XPath Preprocessing - InfoPath Dev
in

InfoPath Dev

Data Source XPath Preprocessing

Last post 10-12-2009 07:52 AM by Jimmy. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-08-2009 06:45 AM

    Data Source XPath Preprocessing

    Hi guys,

    I have an XML data source which has an XPath expression in one of the columns being pulled in. This column will evaluate to true or false based on other elements in the data source. Is it possible to process the data source and make it evaluate that XPath expression rather than display it as a string? I thought this would need to be performed using a script but haven't found anything like it from Google.

    Thanks,

    Ben

  • 10-12-2009 05:14 AM In reply to

    Re: Data Source XPath Preprocessing

     I can't think of any way to do this without using code/script.  Against which data source is the expression going to be evaluated?  Could you give us an example of what the expression might look like?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 10-12-2009 07:21 AM In reply to

    Re: Data Source XPath Preprocessing

    The expression in the secondary data source will evaluate against all data sources, but mostly primary from what I understand. Are there any script examples of this being done or suggested methods for me to get started on?

  • 10-12-2009 07:52 AM In reply to

    Re: Data Source XPath Preprocessing

    This tutorial should have everything you need to get started working with the XPathNavigator in InfoPath 2007.  If you're fairly new to coding, you'll first have to learn how to use it to get your string values out of the data source and into variables in your code.

    http://msdn.microsoft.com/en-us/library/bb509311.aspx

    Once you've done that, you can use the XPathNavigator's Evaluate() function to evaluate your XPath expressions and get a value:

    http://msdn.microsoft.com/en-us/library/system.xml.xpath.xpathnavigator.evaluate.aspx

     

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.