Re: set value for more than one element in select1?

Hi Erik,

Hopefully, some clarifications below.

On Mon, 2006-07-24 at 15:07, Erik Bruchez wrote:
> Andrew S. Townley wrote:
> > Hi,
> > 
> > I was wondering what the recommended solution to this particular
> > situation might be.  I have a code list of values intended for a select1
> > control defined like this:
> > 
> > <CodeList>
> >   <Item Code="...">Value</Item>
> >   ...
> > </CodeList>
> 
> This being referred to from xforms:itemset, right?

Yes, the above would be the source for the itemset within a select1.

> 
> > However, once the value is selected from the select1, I need to include
> > it in the following XML instance document:
> > 
> > <Element>
> >   <ItemName/>
> >   <ItemCode/>
> >   ...
> >   <OtherElement/>
> > </Element>
> 
> The above is not clear: what do you mean by "include it"?

Apologies.  It seemed perfectly clear when I wrote it yesterday. :)

The root of the problem is that I need to convert a single element with
attributes into two elements within my model based on whatever the
current selection happens to be.

So, if in the above, I have selected the following in the select1

<Item Code="Fred">Yellow</Item>

I need this to end up in the instance document as:

<Element>
  <ItemName>Yellow</ItemName>
  <ItemCode>Fred</ItemCode>
  ...
  <OtherFormElements/>
</Element>

I realize that ideally the value from the select could be used "as is"
in the final instance document, but I'm trying to populate an instance
with what might as well be an external schema.  As I said, I suspect the
only viable option is to create a new, intermediate instance that allows
me to embed the original <Item> element as is, and the post-process the
resulting instance to generate the instance that I eventually need to
create, but I wanted to make sure there wasn't a better way.

Does this help?

ast
***************************************************************************************************
The information in this email is confidential and may be legally privileged Access to this email by anyone other than the intended addressee is unauthorized. If you are not the intended recipient of this message, any review, disclosure, copying, distribution, retention, or any action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. If you are not the intended recipient, please reply to or forward a copy of this message to the sender and delete the message, any attachments, and any copies thereof from your system.
***************************************************************************************************

Received on Monday, 24 July 2006 14:30:47 UTC