xsl-list
[Top] [All Lists]

SVG object creation with XSLT using successive abstraction layers

2005-11-03 11:04:07
I am using XSLT to generate SVG code from an XML page description.

I have identified different objects as primitives (buttons, labels, ...)
that I call "basic objects".

I have also identified "higher level" objects that could be built by using basic
objects.

I would like to use on the same XML page description both "basic" and "higher"
level objects. Something like this:

<page>
    <basic id="a" x="10" y="100" />
    <higher id="b" x="40" y="200" />
</page>

My problem is with the XSLT. I have tried something like this:

<xsl:template match="basic">
...
Here goes the expression of a basic object in SVG code
...
</xsl:template>

<xsl:template match="higher">
    <basic id=".0" x="100" y="200" />
    <basic id=".1" x="110" y="200" />

    <xsl:apply-templates select="basic" />
</xsl:template>


<xsl:template match="page">
   <xsl:apply-templates select="higher" />
   <xsl:apply-templates select="basic" />
</xsl:template>


What I would like to obtain is that once the "higher" level object
is expanded in terms of the "basic" objects (by the match="higher"
template), the constitutive "basic" objects could be expanded
into SVG code.

I would like to be able to use this paradigm of expressing higher level
objects in terms of basic ones in an scenario with an arbitrary
number of layers, not only two as I comment here for clarity.

Could any one of you provide me with a clue?


Best regards,

Luis Vielva.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>