SVG object creation with XSLT using successive abstra
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.
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format