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

@if and @src

From: Leigh L. Klotz, Jr. <Leigh.Klotz@Xerox.com>
Date: Thu, 11 Jun 2009 13:11:36 -0700
Message-ID: <4A3164F8.8040400@Xerox.com>
To: public-forms@w3.org
Here's a partly-baked idea that came from today's vFtF:

Add @src to model as Steven suggested, but also to bind.
Add @if to all elements except
- 
model                                                                           

- value
- label
- submission
- mediatype
- filename

For all elements already posessing @ref or @nodeset, @if is roughly 
equivalent to what can be done by these existing patterns:
 <elt ref="x" if="pred" /> --> <elt ref="x[pred]" />
 <elt nodeset="x" if="pred" /> --> <elt nodeset="x[pred]" />

but it's more declarative and it's less likely to lead to unintended 
consequences
- relative paths would be allowed with context references, instead of 
having to be absolute
- no interop problem of some processors supporting "." in variance with 
XPath 1.0 spec and others properly but pedantically requiring self::node().

So, putting them together:

<bind if="mode=view">
  <bind nodeset="/" readonly="true" />
</bind>

Or, consider this:

<select ref="abc">
  <label>ABC</label>
  <choices>
     <item if="../def = 1">
        <label>Hi</label>
        <value>Hi</value>
     </item>
  </choices>
</select>
Received on Thursday, 11 June 2009 20:12:14 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 October 2013 22:06:51 UTC