PDA

View Full Version : [XSL / SVG] Mettere elementi in riga


magix2003
26-02-2009, 10:15
Ciao a tutti,

ho un problema con un foglio xslt che utilizzo per creare un SVG da un file XML.

Questo è l'XML:

<?xml version="1.0" encoding="UTF-8"?>
<graphic>
<page>
<id>page_1</id>
<visible>true</visible>
<concepts>
<concept>

</concept>

<concept>

</concept>
<concept>

</concept>
<concept>

</concept>
</concepts>

<objectproperties>
<objectproperty>

</objectproperty>
</objectproperties>
<dataproperties>
<dataproperty>
</dataproperty>
<dataproperty>

</dataproperty>
</dataproperties>
</page>

<page>
<id>page_2</id>
<visible>false</visible>
<concepts />
<objectproperties />
<dataproperties />
</page>
</graphic>


Quello che vorrei fare è che per ogni elemento page nell'xml corrisponda un bottone nel SVG.
Questi bottoni dovrebbero essere allineati orizzontalmente, del tipo:
Page_1 Page_2

La parte evidenziata in rosso è un misero tentativo non andato a buon fine.



<xsl:template match="page">
<xsl:if test="visible = 'false'">
<g id="{id}" style="display:none;">
applico template
</g>

</xsl:if>
<xsl:if test="visible = 'true'">
applico template
</xsl:if>
<xsl:variable name="offset" select="150" as="xs:integer" />
<text
xml:space="preserve"
style="font-size:18.13334846px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
x="5+$offset"
y="461"
id="{id}_text"><xsl:value-of select="id"/></text>
<rect
id="{id}_rect"
x="5+$offset"
y="446"
width="100"
height="20"
onclick="clearAll()"
style="opacity:0.5;fill:#800080;stroke:#000000;stroke-width:1" />
<text
x="926.68835"
y="422.21945"
dx="5"
dy="15"
font-size="15"
id="text2469"
style="font-size:15px;text-anchor:middle;fill:#000000">Send path</text>

<rect
id="send"
x="876"
y="422"
width="100"
height="20"
onclick="performSideEffects(evt)"
style="opacity:0.5;fill:#800080;stroke:#000000;stroke-width:1" />
</xsl:template>



</xsl:stylesheet>


Qualcuno mi sa consigliare un modo per risolvere questo problema?

Grazie,

Giorgio

magix2003
27-02-2009, 09:12
Uppete :)

magix2003
01-03-2009, 21:47
Proprio nessuno? :help:

Hardware Upgrade Forum Database Error
Database Error Database error
The Hardware Upgrade Forum database has encountered a problem.

Please try the following:
  • Load the page again by clicking the Refresh button in your web browser.
  • Open the www.hwupgrade.it home page, then try to open another page.
  • Click the Back button to try another link.
The www.hwupgrade.it forum technical staff have been notified of the error, though you may contact them if the problem persists.
 
We apologise for any inconvenience.