Some user can help me with an example of recursion for display an svg tree with nodes....
for example:
A
/ \
B C
/ \
.... .....My preocupation is howto capture and save position previous and next nodes father and subnodes,etc.
I have the follow code but not know if is efficient.
//file xml <?xml version="1.0"?> <xsp:page xmlns:xsp="http://apache.org/xsp" xmlns:session="http://apache.org/xsp/session/2.0" xmlns:cinclude="http://apache.org/cocoon/include/1.0"> <estructura> <componente posicionX="250" posicionY="40">
<descripcion>raiz</descripcion>
<etiqueta>name</etiqueta> <contiene>
<componente posicionX="350" posicionY="100">
<descripcion>hijo1</descripcion>
<etiqueta>name1</etiqueta>
</componente> <componente posicionX="170" posicionY="100">
<descripcion>hijo2</descripcion>
<etiqueta>name2</etiqueta>
</componente>
</contiene>
</componente>
</estructura>
</xsp:page>//code xsl <?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="estructura">
<svg width="1000" height="1000">
<!-- definiciones para usar despues -->
<defs>
<filter id="blur1"><feGaussianBlur stdDeviation="3"/></filter>
<filter id="blur2"><feGaussianBlur stdDeviation="1"/></filter>
<filter id="dropShadow" filterUnits="userSpaceOnUse" x="0" y="0" width="500" height="500">
<feOffset in="SourceAlpha" dx="5" dy="5" result="offset"/>
<feGaussianBlur in="offset" stdDeviation="5" result="blur"/>
<feMerge><feMergeNode in="blur"/><feMergeNode in="SourceGraphic"/></feMerge>
</filter>
</defs>
<!-- grafica -->
<g title="this is a tooltip">
<!-- definimos la plantilla area de trabajo -->
<rect x="2" y="2" width="600" height="600" fill="none" stroke="black" stroke-width="2"/>
<xsl:apply-templates/>
</g>
</svg>
</xsl:template>
<xsl:template match="componente">
<circle cx="[EMAIL PROTECTED]" cy="[EMAIL PROTECTED]" r="13" style="fill:red;stroke:black;stroke-width:3;filter:url(#dropShadow);"/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="contiene">
<xsl:for-each select="componente">
<!-- <line x1="250" y1="53" x2="[EMAIL PROTECTED]" y2="[EMAIL PROTECTED]" stroke-width="2" stroke="#030959"/> -->
<circle cx="[EMAIL PROTECTED]" cy="[EMAIL PROTECTED]" r="13" style="fill:yellow;stroke:black;stroke-width:3;filter:url(#dropShadow);"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Bye, thanks very much
-- Cordialmente,
Andres Taborda Departamento de Sistemas http://www.saludcolombiaeps.com.co email:[EMAIL PROTECTED] SaludColombia E.P.S. - Una Sola Familia Calle 5C # 43-05 Tequendama Telefono : 57 (002) 551 04 89 - 57 (002) 551 04 90 Ext 119 Cali - Colombia
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
