"facher" ?
Autres recommandations W3C :
http://www.w3.org/TR/SVG11/ Spécifications du SVG 1.1
http://www.w3.org/TR/SVGMobile/ Spécification du SVG mobile (telephones portable pda notebook etc.)
Working Drafts :
http://www.w3.org/TR/SVG12 Spécifications SVG 1.2
http://www.w3.org/TR/SVGPrint/ Spécification SVG print
Comme je bosse à fond dedans en ce moment
, voici un exemple d'utilisation de XML et XSL pour produir du SVG :
fichier de données xml : :
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="graph-inline2.xsl" ?>
<data>
<bar fill="#096"><v>4</v><l>A</l></bar>
<bar fill="#996"><v>6</v><l>B</l></bar>
<bar fill="#060"><v>5</v><l>C</l></bar>
<bar fill="#900"><v>6</v><l>D</l></bar>
<bar fill="#009"><v>7</v><l>E</l></bar>
</data>
|
fichier de traitement XSL : graph-inline2.xsl :
<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:asv="http://www.adobe.com/svg">
<xsl: output method="xml" encoding="utf-8" indent="yes" />
<xsl:template match="data">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:asv="http://www.adobe.com/svg" >
<head>
<object id="asv" classid="clsid:78156a80-c6a1-4bbf-8e6a-3cd390eeb4e2">
</object>
<xsl: processing-instruction name="import">
namespace="asv" implementation="#asv"
</xsl: processing-instruction>
</head>
<body>
<p><b>XML * XSLT -> SVG</b></p>
Script-free inline SVG graph...<br/>
<asv:svg width="400px" height="400px">
<xsl:for-each select="bar">
<xsl:variable name="val">
<xsl:value-of select="v"/></xsl:variable>
<!-- labels -->
<asv:text x="10" y="{position()*17}">
<xsl:value-of select="l"/></asv:text>
<!-- chart bars -->
<asv: path d="M30,{position()*15} H{$val*20}" stroke-width="10px" stroke="{@fill}"/>
</xsl:for-each> </asv:svg>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
|
Voilà comme ca ca fait aussi un exemple concret de génération de graphiques directement à partir d'un fichier de données XML .... on pourrait aussi bien l'afficher sous forme de tableaux avec des chiffres, en partant du même fichier XML.
http://digitalcraft.com.au/svg/too [...] eXSLT2.asp ou comment produire du svg coté client à partir de XML de trois façons différentes ....
http://digitalcraft.com.au/svg/ un site tres propre avec exemples tutoriels et démo
Message édité par hiroito_protagoniste le 22-08-2003 à 15:58:57