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

Re: Repeat styling problem

From: Mark Seaborne <m_seaborne@mac.com>
Date: Fri, 5 May 2006 09:16:08 +0100
Message-Id: <F0F415C2-7417-4AC1-A946-115C4116F28D@mac.com>
To: www-forms@w3.org

To answer my own question, the only things I have been able to come  
up with are not very pleasant, but do work.

The first idea is to use the XPath expressions used to set the  
relevance of an assert to set a value in an XML instance and then  
test that to see whether the parent pattern is relevant or not.

The second idea (from David Landwehr) was to do essentially the same  
thing, but without modifying XML values. He suggested reusing the  
relevance statements within the repeat/@nodeset expression itself.

Neither solution is very satisfactory from an authoring perspective.

Perhaps it would be easier if it was possible to test the relevance  
of a node within XPath? There are probably similarly useful use cases  
for being able to test the state of other MIPs in XPath too.

If anyone can think of anything better that will work now I would be  
very grateful.

All the best

Mark

On 4 May 2006, at 16:00, Mark Seaborne wrote:

>
> Hi,
>
> Can anyone tell me how to achieve the following:
>
> I have an XML instance like this:
>
> <schema>
> 	<pattern name="fred">
> 		<rule>
> 			<assert/>
> 		</rule>
> 		<rule>
> 			<assert/>
> 			<assert/>
> 		</rule>
> 	</pattern>
> 	<pattern name="bob">....</pattern>.
> </schema>
>
> At any one time zero or more assert elements are relevant.
>
> I have used repeats in the following way:
>
> <repeat nodeset="pattern">
> 	<group ref=".">
> 		<label><output value="@name"/></label>
> 		<repeat nodeset="rule/assert"/>
> 	</group>
> </repeat>
>
> So I get a list of all the patterns, with each pattern followed by  
> a list of its currently relevant assert elements.
>
> When there are no relevant assert elements for a pattern I want to  
> hide the label for the group bound to that pattern. I can't work  
> out how to achieve that. I am hoping that I have overlooked some  
> obvious solution, and that someone will be kind enough to point it  
> out to me.
>
> All the best
>
> Mark
>
>
Received on Friday, 5 May 2006 08:16:37 GMT

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