Transformation xml vers svg avec xslt
Bonjour,
tu as le fichier xml, il te reste donc à trouver un programme, comme saxon par exemple, et ta feuille de style toSvg.xsl.
Ton fichier xsl devrait ressembler à qlqch comme ca :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| <?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"
doctype-public="-//W3C//DTD SVG 20010904//EN"
doctype-system="~http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"/>
<xsl:template match="/">
<svg width="XXX" height="YYY">
<xsl:apply-templates/>
</svg>
</xsl:template>
<xsl:template match="tdt">
<g><xsl:apply-templates/></g>
</xsl:template>
<xsl:template match="latitude | longitude">
<text><xsl:value-of select="."/></text>
</xsl:template>
</xsl:stylesheet> |
Ensuite :
saxon source.xml toSvg.xsl > out.svg