Re: [Xsltforms-support] Accessing the results of a multi-select
Brought to you by:
alain-couthures
From: Richard L. <ric...@gm...> - 2023-09-28 12:24:30
|
On 28/09/2023 12:50, Steven Pemberton wrote: > Using <xf:copy ref="."> instead of <xf:value ref="@id">? Ah, clever! (I have a lot to learn ...) Thank you: I can now get the text content of all the selected XML records dumped out as a long unformatted string, using <xf:output ref="Object/ItemList">. I see I can use the value attribute on <xf:output> to evaluate a single XPath expression, but is there a way of iterating over the nodeset of selected Object elements and just outputting selected elements, ideally with some formatting? Thanks, Richard > > Steven > > On Thursday 28 September 2023 12:40:17 (+02:00), Richard Light wrote: > > Hi, > > When I make a selection from a number of options: > >> <xf:select bind="object-list" appearance="full"> >> <xf:label>Objects to move:</xf:label> >> <xf:itemset model="objects-chosen" >> nodeset="instance('objects')/record"> >> <xf:label ref="Object/ObjectIdentity/Number"/> >> <xf:value ref="@id"/> >> </xf:itemset> >> </xf:select> > The <object-list> in my model is dynamically populated with a > space-separated list of id's. > > What I would like to be able to do is to display (elsewhere on the > XForm) selected information for each of the objects which is > currently selected. I can (and currently do) display /all /the > objects, e.g.: > >> <h4>Object details:</h4> >> <div> >> <p><b><xf:output >> ref="instance('objects')/record[1]/Object/ObjectIdentity/Number"/></b> >> <br/><b>Identification: </b> <xf:output >> ref="instance('objects')/record[1]/Object/Identification/ObjectName/Keyword"/>; >> >> <xf:output >> ref="instance('objects')/record[1]/Object/Identification/BriefDescription"/></p> >> </div> > Is there a way of iterating over the selected objects and > outputting only their details? > > Thanks, > > Richard > > -- > ------------------------------------------------------------------------ > *Richard Light* > ric...@gm... > /@richardofsussex/ > -- ------------------------------------------------------------------------ *Richard Light* ric...@gm... /@richardofsussex/ |