W3C home > Mailing lists > Public > www-forms@w3.org > December 2006

Re: Styling based on instance data

From: Steve K Speicher <sspeiche@us.ibm.com>
Date: Mon, 4 Dec 2006 13:38:55 -0500
To: "www-forms" <www-forms@w3.org>
Message-ID: <OFD4B7A18D.F1814986-ON8525723A.0064B569-8525723A.006652CB@us.ibm.com>

Perhaps my case is slightly different, styling based on a control's bound 
node's value.

On thing along these lines that I've wanted to do is:

<style type="text/css">
...
xforms|*::value[content="blue"] { background-color: blue; }

Where the implicit attribute "content" would enable things like having 
select's item be blue as well as the select's value being blue (when 
choice of "blue" of course).

- Steve Speicher


"Klotz, Leigh" <Leigh.Klotz@xerox.com> wrote on 11/30/2006 06:37:00 PM:

> 
> Itwouldbeniceif you could use CSS to style the background of repeat
> items yellow if they are "selected" in the data using some magical CSS
> XPath selector:
> 
> <style type="text/css">
> 
> repeat.lines::repeat-item[xpath(boolean-from-string(instance()/lines/lin
> e/@selected))] { background-color: yellow; }
>   ...
> </style>
> 
> <repeat class="lines" nodeset="lines/line">
>   <input ref="@selected">
>     <label class="columnHeader">X</label>
>   </input>
>   <output ref="date">
>     <label class="columnHeader">Date</label>
>   </output>
>   <output ref="name">
>     <label class="columnHeader">Name</label>
>   </output>
> </repeat>
> 
> 
Received on Monday, 4 December 2006 18:37:58 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:08 GMT