Region ID question

Hi, I have a question about the region id attribute in the context of switch
statements.  

The region's id attribute (as with all id attributes) is defined as a type
ID.  This means in the general XML syntax, it is illegal to have more than
one region (or element, in general) defined with the same id value.  

However, it seems that having multiple regions defined in a switch with the
same id could make code for body elements that refer to the region much
simpler.  a quick example, ideally i would like to be able to do this:

<switch>
	<layout systemScreensize="500x100">
		<region id="r1" .. >
	</layout>
	<layout>
		<region id="r1" .. >
	</layout>
</switch>
..
<body>
	...
	<ref region="r1" ...>
</body>

so in this case, i may not care about changing the size of the image (ref)
based on the screen size, just how things are laid out.  here, regardless of
which region is chosen, the ref uses that region... however, as mentioned
above, this is not legal SMIL (or XML).  because id is of type ID i need to
have unique values there.  The catch is that now i MUST switch on the ref
element as well just to have the correct id reference, even though there is
nothing inherent in that element that cares about screen size.. as such:

<switch>
	<layout systemScreensize="500x100">
		<region id="r1" .. >
	</layout>
	<layout>
		<region id="r2" .. >
	</layout>
</switch>
..
<body>
	...
	<switch>
		<ref region="r1" systemScreensize="500x100" ...>

		<ref region="r2" ...>
	</switch
</body>


So i guess my question is whether my understanding of this restriction is
correct.  

Note, there is an added region attribute in SMIL 2.0 called regionName which
seems to have been defined specifically to get around this since it can also
be used to reference a region from the body elements but it is not a unique
identifier and thus its value can be shared amongst multiple regions.  If my
understanding about regionName is correct, the solution looks like this (of
course this is only legal for 2.0):

<switch>
	<layout systemScreensize="500x100">
		<region id="r1" regionName="reg1" .. >
	</layout>
	<layout>
		<region id="r2" regionName="reg1".. >
	</layout>
</switch>
..
<body>
	...
	<ref region="reg1" ...>
</body>


Is my understanding correct here?

thanks,

Mike

Received on Thursday, 18 April 2002 13:20:59 UTC