Jinntec / Fore

Fore - declarative user interfaces in plain HTML
MIT License
80 stars 11 forks source link

Context in nested repeat #223

Closed JoernT closed 10 months ago

JoernT commented 1 year ago

Discussed in https://github.com/Jinntec/Fore/discussions/221

Originally posted by **timathom** June 27, 2023 I have a form (below) with a nested repeat in which I'd like to reference the current context node in an XPath expression. This doesn't work. However, if I define a variable to capture the context node within the nested repeat, then I can reference it from the XPath expression. Shouldn't I be able to use `context()` in this context? :) ``` MARCO
bf:mainTitle bf:subtitle bf:responsibilityStatement 245 a
```
DrRataplan commented 10 months ago

Got it. The context function missed support for repeats in the zero-arity variant of the context function. Passing the id of the repeat would fix it. Fixed the whole thing by reusing the same indexing algorithm we had already.