Using associations in XPath Contraint

Situation I have an OrderHead and associated OrderLines. The User can add comments to the order Lines. Comment is an Entity and an OrderLine can have many comments (1-to-many relationship). I have a page displaying OrderHead with associated OrderLines. Now, I would like to show all comments associated with the OrderHead in a template grid. To be clear: The comments are associated with the OrderLines, but the templateGrid should show comments across all OrderLines of an OrderHead. Solution Therefore, I have created a dataView listening to the OrderHead. Nested inside the dataview is a templategrid to display the comments. Datasource Type: Comments Entity from Database I need to narrow down the comments records to the ones associated with the OrderHead. To that end, I would like to use an XPath constraint. Here I got stuck. I assume, it should read something like XPath Constraint: [ Selected OrderHead ID = OrderHead ID of OrderLine ID that is associated with Comment Record] I just cannot make this work. Any ideas are welcome :) Here is a screenshot of the entities: Domain Model Screenshot
1 answers

Should be something like