Expand my Community achievements bar.

SOLVED

How to bind form to an XML element with a specific attrib/value?

Avatar

Level 1

Is there a way to bind a form in the designer to an XML element using an attribute value as criteria?  This is a very basic construct in XPath and I'd be hard pressed to believe the form designer cannot do this.  For example:

<bookstore>

<book lang="eng">
   <title>Harry Potter</title>
   <price>29.99</price>
</book>

<book lang="sp">
   <title>Learning XML</title>
   <price>39.95</price>
</book>

</bookstore>

I wish to bind to only the the book node with a lang attribute of "eng".

The simple xpath reference would be: /bookstore/book[@lang='eng']

Thanks for any help anyone can provide.  I'm new to the LiveCycle Designer

Jordon

1 Accepted Solution

Avatar

Correct answer by
Level 10

You need to use the below expression in the Data Binding property to get the title of the book whose language is eng.

$.book.(lang.value=="eng").title

Thanks

Srini

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

You need to use the below expression in the Data Binding property to get the title of the book whose language is eng.

$.book.(lang.value=="eng").title

Thanks

Srini