You are viewing limited content. For full access, please sign in.

Question

Question

For HTML/XHTML documents, is it possible to replace the XPATH string created by the profile creation wizard?

asked on March 27, 2015

I am working with a web-based application in which the code changes structure based on the presence or absence of data for the elements. The code created by the wizard works for the specific record displayed, but will not work for others. In the profile, the path seems to be an XPATH statement. Since I can select the required element using XPATH, this prompted the question can this path be replaced with a custom XPATH statement to locate the value of an element (attribute in this case). 

As an example, I would like to change the code from:

                  <Attributes>
                    <Attribute name="Condition" value="/Root[1]/Document[1]/Table[1]/Custom[2]/Custom[1]/Custom[2]/Edit[40]" />
                    <Attribute name="Property" value="Value" />
                  </Attributes>

to

                  <Attributes>
                    <Attribute name="Condition" value="//input[@id='plan:sellerFirstNameField:sellerFirstName']" />
                    <Attribute name="Property" value="Value" />
                  </Attributes>

If so, is it using XPATH 1.0 or 2.0?

 

Thanks.
 

 

 

0 0

Answer

SELECTED ANSWER
replied on March 29, 2015

Yes, it is using XPATH 1.0.

However, I am afraid the change you mentioned will not work. The reason is that, the XPATH statement is performed against an internal XML document, but the "input[xxxx]" is from the web HTML.

If you want to customize the statement, please run Laserfiche Connector Test Utility to get the internal XML document and write the XPATH expression of your desired element.

2 0

Replies

replied on March 27, 2015

Yes, you can edit this string to change the XPath expression used.

It's using the .Net XML-related classes under the hood, which from what I can tell means XPath 1.0.  Perhaps someone from the team can confirm this.

1 0
replied on March 30, 2015

Thank you both for the information. This was very helpful in learning how to further customize the searches in Laserfiche Connector. Both custom profiles for the client are now working correctly.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.