jorisdewinne wrote:

>
> Hello,
>
> I want to do define a structure and use that structure several times,
> each with a different set of parameters. Anyone knows how to do this?
>
> Example:
>
> <defs>
> <rect id="rect1" x="parX" y="parY" width="parWidth" height="parHeight"/>
> <rect id="rect2" x="parX" y="parY" width="parWidth" height="parHeight"/>
> </defs>
>
> <use xlink:href="#rect1" parX="10" parY="10" parWidth="200"
> parHeight="200"/>
> <use xlink:href="#rect2" parX="210" parY="210" parWidth="100"
> parHeight="100"/>
>
> The problem is I have no idea how I can specify the parameters? Of
> course this is a simple example and more special parameters will be
> used like stroke colors and even own defined tags (extension mechanism
> in Batik)
>
> Any help is welcome!
>
> Joris
>
hi Joris
you cant pass parameters at all, you use a symbol like this:

<symbol  id="rect1" viewBox="0 0 50 50" preserveAspectRatio="none">
<rect x="0" y="0" width="50" height="50"/>
</symbol>

<use xlink:href="#rect1" x="100" y="200" width="100" height="100"/>   
<!--this will place the rect with the dimensions 100/100 at 100/200 -->

<use xlink:href="#rect1" x="100" y="200" width="100" height="100" 
fill="green"/>    <!-- this rect will additionaly be filled green -->

<g fill="red"><!--two rects will be shown, both filled red , but with 
different dimensions-->
<use xlink:href="#rect1" x="200" y="200" width="100" height="100"/>
<use xlink:href="#rect1" width="200" height="200"/>
</g>

the last example use normal inheritance rules. note! only propertys will 
get inherited.
see:
http://www.w3.org/TR/SVG/propidx.html
for a list of propertys you can use.

it depends on what you want to do exactly, maybe you can use xslt as a 
first step to pass paramenters to shape definitions.
try an svg enabled mozilla build ( http://www.mozilla.org/projects/svg/ 
) which is a great tool to develop svg creating xslts.
if you use that build you might also want to look at XBL, examples can 
be found here:
http://www.croczilla.com/svg/samples/

there is no implementation yet, though you might also want to look at 
sXBL ( http://www.w3.org/TR/sXBL/ )

regards
Holger


-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to