W3C home > Mailing lists > Public > www-forms@w3.org > June 2009

How to ensure that at least one of 2 attributes is set to true

From: Manfred Staudinger <manfred.staudinger@gmail.com>
Date: Sun, 21 Jun 2009 22:10:27 +0200
Message-ID: <a946be3a0906211310v3b196f6bla7d1f5249cfd1166@mail.gmail.com>
To: www-forms@w3.org
Hi List,

I'm new to XForms, read a lot but still missing something: I did not
find a solution (other than post-processing with xslt). I want to make
sure that at least one of the 2 attributes
(MIETE_PACHT, KAUF) is set to true (1). If this is not the case, I
would like to get a message or even prevent the document from being
Here is my instance and the bind:
   <xf:instance xmlns="http://www.example.com">
         <vermarktungsart MIETE_PACHT="0" KAUF="0" />

   <xf:bind nodeset="im:objektkategorie/im:vermarktungsart/@MIETE_PACHT"
type="xs:boolean"  />
   <xf:bind nodeset="im:objektkategorie/im:vermarktungsart/@KAUF"
type="xs:boolean"  />
   <xf:submission id="saveDoc" method="put">
      <xf:resource value="concat('test/fertigobjekt',
im:verwaltung_techn/ic:objektnr, '.xml')"/>

Input fields are:
   <xf:input ref="im:objektkategorie/im:vermarktungsart/@KAUF">
      <xf:label>Verkauf: &nbsp;</xf:label>
   <xf:input ref="im:objektkategorie/im:vermarktungsart/@MIETE_PACHT">
      <xf:label>Vermietung (Miete, Pacht): &nbsp;</xf:label>

Remarks about the example above and pointers to sources are also
appreciated. Thanks!

Manfred Staudinger
Received on Monday, 22 June 2009 08:53:01 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:22 UTC