This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: new user xslt
- From: CHAOUI Hassan <HCHAOUI at unedic dot fr>
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Date: Mon, 29 Apr 2002 11:59:42 +0200
- Subject: RE: [xsl] new user xslt
- Reply-to: xsl-list at lists dot mulberrytech dot com
This the xsl file :
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml" omit-xml-declaration="no" indent="yes"
encoding="iso-8859-1"/>
<xsl:template match="mydoc">
<document>
<xsl:apply-templates/>
</document>
</xsl:template>
<xsl:template match="h1">
<titre1>
<xsl:apply-templates/>
</titre1>
</xsl:template>
<xsl:template match="h2">
<titre2>
<xsl:apply-templates/>
</titre2>
</xsl:template>
<xsl:template match="h3">
<titre3>
<xsl:apply-templates/>
</titre3>
</xsl:template>
<xsl:template match="h4">
<titre4>
<xsl:apply-templates/>
</titre4>
</xsl:template>
<xsl:template match="h5">
<titre5>
<xsl:apply-templates/>
</titre5>
</xsl:template>
<xsl:template match="h6">
<titre6>
<xsl:apply-templates/>
</titre6>
</xsl:template>
<xsl:template match="ht">
<ht>
<xsl:apply-templates/>
</ht>
</xsl:template>
<xsl:template match="p">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="list[@style = "bullet"]">
<bullet>
<xsl:apply-templates/>
</bullet>
</xsl:template>
<xsl:template match="list[@style = "numeric"]">
<listeNumerique>
<xsl:apply-templates/>
</listeNumerique>
</xsl:template>
<xsl:template match="item">
<liste>
<xsl:apply-templates/>
</liste>
</xsl:template>
<xsl:template match="ex">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="table" xsl:space="preserve">
<tableau>
<xsl:apply-templates/>
</tableau>
</xsl:template>
<xsl:template match="row">
<xsl:element name="{cell[1]}">
<xsl:value-of select="normalize-space(cell[2])"/>
</xsl:element>
</xsl:template>
<!--xsl:template match="row" xsl:space="preserve">
<ligne>
<xsl:apply-templates/>
</ligne>
</xsl:template>
<xsl:template match="cell" xsl:space="preserve">
<cellule>
<xsl:apply-templates/>
</cellule>
</xsl:template-->
<xsl:template match="dl">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="dd">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="dt">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="note">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="attention">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="kw" xsl:space="preserve">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="link[@url]">
<lien>
<xsl:attribute name="href">
<xsl:value-of select="@url"/>
</xsl:attribute>
<xsl:apply-templates/>
</lien>
</xsl:template>
<xsl:template match="b">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="u">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="i">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="tm">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="exemple">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="graphic">
<image>
<xsl:attribute name="SRC">
<xsl:value-of select="@url"/>
</xsl:attribute>
</image>
</xsl:template>
</xsl:stylesheet>
and this is the xml file :
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<?xml:stylesheet type="text/xsl" href="mydoc.xsl"?>
<mydoc>
<h1>
<ht>Introduction :</ht>
</h1>
<h1>
<ht>Historiques des évolutions :</ht>
<h2>
<ht>A- Evolutions de la V5.3 :</ht>
<table>
<row>
<cell width="121">
<p>Partie modifiée</p>
</cell>
<cell width="337">
<p>Evolution</p>
</cell>
</row>
<row>
<cell width="121">
<p>Identification des
règles</p>
</cell>
<cell width="337">
<p>Modification de forme :
COD07 devient COD07RA</p>
</cell>
</row>
<row>
<cell width="121">
<p>B006</p>
</cell>
<cell width="337">
<p>Renvoi vers le tableau
paramètre de l'assimilation</p>
</cell>
</row>
<row>
<cell width="121">
<p>Paramètre P008</p>
</cell>
<cell width="337">
<p>Assimilation de la
formation</p>
</cell>
</row>
</table>
</h2>
</h1>
</mydoc>
Thank for helping
+----------------------------------------------------------------+
| Ce courrier ainsi que les fichiers joints sont confidentiels. |
| Si vous avez recu ce courrier par erreur, veuillez en informer |
| l'administrateur du systeme : exp-iris@unedic.fr |
| --------- |
| Ce message confirme que le courrier a passe le controle |
| antivirus du relais de messagerie Internet avec succes. |
+----------------------------------------------------------------+
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list