Re: Repeat styling problem

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 UTC