-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to get attribute value using the <fx-output> element #287
Comments
@daliboris It's not 100% clear to me what you're trying to achieve/expecting - output both occurrences of We'll have a look at this. |
I think both occurrences here might make sense. But on the other hand, for
a control you definitely don't want to edit both instances at once, right?
What does the xforms spec say? That's usually a good guideline
…On Mon, 16 Sept 2024, 13:24 Joern Turner, ***@***.***> wrote:
@daliboris <https://github.com/daliboris> It's not 100% clear to me what
you're trying to achieve/expecting - output both occurrences of @type?
We'll have a look at this.
—
Reply to this email directly, view it on GitHub
<#287 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABGKEJFTNDQFJPMBICER57LZW25YRAVCNFSM6AAAAABOGG6K5OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJSGY2DSMBXGY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
The XForms spec says that controls (including output) use 'single item binding':
Further there not a single example using both Though we don't necessarily need to follow the spec in all cases i guess it makes sense here to restrict controls to 'single item bindings' - the only exception (of course) is the repeat element. Therefore if you want to output multiple nodes/values you'll have to use fx-repeat or maybe have your own custom function for that. |
@daliboris could you please give more context about your use case? If we know what you're trying to achieve we can help to work out a solution but we need to clarify if this is really an issue or otherwise needs addressing/working out a solution. |
I'll leave the ticket open for another week or so but i don't see an issue here though i might be missing something. If you can please elaborate on the problem? Is it still a problem? If so, we can work out a proper solution if we have a concrete use case to fulfill. |
I'm trying to get the value of the attribute using the
<fx-output>
element.Sample input data:
Each of the the following statement returns
undefined
in the output (HTML page):Two following approaches return the value, but the result contains only one item while the source contains two elements with the
@type
attribute.The
<fx-repeat>
element with template expressions returns the expected result: two values of the@type
attribute:Is it possible to use XPath for retrieving attribute value of the element from within
@value
attribute of the<fx-output>
element?I know that for repeated elements using
<fx-repeat>
element makes sense, but even if the source<note>
element contains only one<cit>/<quote>
sequence the<fx-output ref="app//quote" value="./@type" />
or<fx-output ref="app/note/cit/quote" value="./@type" />
returnsundefined
.The text was updated successfully, but these errors were encountered: