Hi everyone,
Just another little problem. I have an instance "Element" and sometimes it has an attribute "name", and sometimes attributes "value" and "operator". <Element name="year" operator="!=" value="1995"/> (How can i use operator <= or >= ? < and > are reserved characters are'nt they ?) or <Element name="blabla"/> Am I obliged do declare those attributes in <xforms:instance> because if I don't, I cannot set values (with <xforms:setvalue>) to these attributes. So can I add attributes ? By the way, sometimes i don't want to have any instances of Element but as i declared one in the xforms:instance, i always have one empty instance at start. Am I obliged to deal with this in the xsd schema ? Thanks ! Pierre-Julien -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Hi Pierre-Julien,
> (How can i use operator <= or >= ? < and > are reserved characters > are'nt they ?) Maybe it works if you use the entities > and < (didn't test it) > Am I obliged do declare those attributes in <xforms:instance> because > if I don't, I cannot set values (with <xforms:setvalue>) to these > attributes. So can I add attributes ? You could use empty attributes so you can address and fill them when editing the XForm. I think that's easier than changing the structure of the instance. > By the way, sometimes i don't want to have any instances of Element > but as i declared one in the xforms:instance, i always have one empty > instance at start. Am I obliged to deal with this in the xsd schema ? I'm not sure whether i understand the question correctly - i think you need in fact one (maybe empty) instance on startup so that the structure of the data is defined. florian -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
Florian Schmitt wrote:
> Hi Pierre-Julien, > >> (How can i use operator <= or >= ? < and > are reserved characters >> are'nt they ?) > > Maybe it works if you use the entities > and < (didn't test it) Correct. Even better, you can use the more legible le, ge, lt and gt operators. -Erik -- Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
In reply to this post by Pierre-Julien VILLOUD
Hi Pierre-Julien,
On 5/6/07, [hidden email] <[hidden email]> wrote: > Am I obliged do declare those attributes in <xforms:instance> because if I don't, I cannot set values (with <xforms:setvalue>) to these attributes. > So can I add attributes ? You cannot create an attribute in an instance if it is not there already with <xforms:setvalue>, but your can do so with <xforms:insert>. You need another instance that contains that attribute somewhere: <xforms:instance id="template"> <dummy my-attribute=""/> </xforms:instance> Then you would do: <xforms:insert context="/to/element" origin="instance('template')/@my-attribute"/> <xforms:setvalue ref="/to/element/@my-attribute" value="..."/> Alex -- Orbeon Forms - Web 2.0 Forms for the Enterprise http://www.orbeon.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Thanks a lot Alex, very helpful ! Using this method, i don't have
empty attributes in my xml file, which is nicer ! Pierre-Julien -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Free forum by Nabble | Edit this page |