Expand my Community achievements bar.

Set value with XPath dynamically #2

Avatar

Level 3

I am running into a similar problem as

http://forums.adobe.com/message/2953296#2953296

.but instead of constructing a string from xpath expressions, I'm trying to store a value into a Location based on a concatenated xpath expression.

Here is what I'd like to do but it doesn't work:

/process_data/@Approver_index = 1

Location:

/process_data/formData_flat/xdp/datasets/data/TDCR/RoutingName_[number(/process_data/@Approver_index)]

Expression: 'Bob'

This works if you were to put the string into the Location but Workbench won't accept this as a Location.  How can I dynamically apply a template xpath expression?  Any help would be great.

3 Replies

Avatar

Level 3
Okay, referring to the thread quoted above, I was able to get partway there.  I've assembled the XPATH expression and it's getting assigned dynamically to a new variable.
Now my question is how do I do assign a new value to my dynamically generated XPATH location?
I'm not good with the executeScript service.  I'm sure it's pretty easy.

Avatar

Former Community Member

There was an excellent article written by Deke Smith from Twin Technologies that explains how to use the Execute Script service if you are looking to understand how to use the Execute Script service. This may help you to build the XPath if it is saved as an XML variable.

http://www.adobe.com/devnet/livecycle/articles/building-xml.html

Hope that helps.

...Gil

Avatar

Level 3

Thanks for responding Gil.  This article is the basics of how to use the ExecuteScript service.  I'm familiar with this service.  Specifically, I'm trying to dynamically generate an XPATH location to store data.  Since I don't have a background as a java developer, I'm having trouble figuring out the method to accomplish this.

The link I originally quoted was helpful because it outlined how to dynimcally build the Expression (which I also need ...and actually got working) but it doesn't mention how to build the XPATH location.  For this operation, I need to dynamically build both the Expression and the Location.  I'm halfway there.