From: raphael hunold (rhunold@m6.fr)
Date: 25/04/2001 - 10:29
Bonjour.
J'ai un probleme avec ce XSL .
En effet, Les Templates COMMUN ne fonctionnent que sur le noeud "video_express"
alors que je souhaiterais qu'ils s'appliquent egalement à son noeud fils "elements".
Quelle syntaxe est-ce que je dois utilisée?
Merci d'avance
<?xml version="1.0" encoding="UTF-8"?>
<!-- C:\Demo xsl\presentation_interviews.xsl -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="html" indent="no" encoding="ISO-8859-1"/>
<xsl:template match="video_express">
<!-- Partie gérée par ATG -->
<html>
<head>
<link rel="stylesheet" href="C:\Demo xsl\styles.css" type="text/css"/>
</head>
<body text="#FFFFFF" link="#E3DF68" vlink="#E3DF68">
<table width="477" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="391" valign="top">
<table width="385" border="0" cellspacing="0" cellpadding="5">
<tr bgcolor="#134F7D">
<td class="champtexte">
<!-- Partie gérée par ATG -->
<xsl:if test="not(corps_texte='')">
<xsl:apply-templates select="corps_texte"/><br/>
</xsl:if>
<xsl:if test="not(//signature='')">
<xsl:for-each
select="//signatures/ligne_signature/signature_col/signature">
<xsl:value-of select="." /><br/>
</xsl:for-each>
</xsl:if>
</td>
</tr>
</table>
<table width="385" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="4" background="../images/pointille.gif">
<img src="http://www.turbo.fr/images/pixel.gif" width="2" height="4"></img>
</td>
</tr>
</table>
<table width="385" border="0" cellspacing="0"
cellpadding="0">
<xsl:apply-templates select="elements"/>
</table>
<table width="385" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="10">
<img src="http://www.turbo.fr/images/pixel.gif" width="10" height="4"></img>
</td>
</tr>
</table>
<!-- Partie gérée par ATG -->
</td>
</tr>
</table>
</body>
</html>
<!-- Partie gérée par ATG -->
</xsl:template>
<xsl:template match="elements">
<xsl:for-each select="//elements/element_chapo">
<tr>
<td width="385">
<table width="385" border="0" cellspacing="0"
cellpadding="4" bgcolor="#195889">
<tr>
<td valign="top" width="60">
<xsl:if test="following-sibling::element_image[1]">
<xsl:if test="not(following-sibling::element_image[1]='')">
<A
href="{following-sibling::element_video[1]}">
<img vspace="5" hspace="5"
border="0" width="40" height="40">
<xsl:attribute
name="src">
<xsl:value-of select="."/>
</xsl:attribute>
</img>
</A>
</xsl:if>
</xsl:if>
</td>
<td valign="top" class="champtexte">
<xsl:if test="not(following-sibling::element_chapo[1]='')">
<b><xsl:value-of select="."/></b><br/>
</xsl:if>
<xsl:if test="not(following-sibling::element_texte[1]='')">
<xsl:value-of select="following-sibling::element_texte[1]" />
</xsl:if>
</td>
</tr>
<tr>
<td>
</td>
<xsl:if test="following-sibling::element_video[1]">
<xsl:if test="not(following-sibling::element_video[1]='')">
<td align="right" class="verd8ptbld">
<A>
<xsl:attribute name="href">
<xsl:value-of select="."/>
</xsl:attribute>
<xsl:attribute name="target">
_blank
</xsl:attribute>
<xsl:attribute name="class">
passouligne
</xsl:attribute>
regarder la video !
</A>
</td>
</xsl:if>
</xsl:if>
</tr>
</table>
</td>
</tr>
<tr>
<td height="5" background="../images/pointill_bleu.gif">
<img src="http://www.turbo.fr/images/pixel.gif" width="2" height="1">
</img>
</td>
</tr>
</xsl:for-each>
</xsl:template>
<xsl:template match="signatures">
<xsl:for-each select="//signatures/ligne_signature/signature_col/signature">
<xsl:value-of select="." /><br/>
</xsl:for-each>
</xsl:template>
<!--COMMUN-->
<xsl:template match="P">
<br/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="B">
<b>
<xsl:value-of select="."/>
</b>
</xsl:template>
<xsl:template match="BLOCKQUOTE">
<blockquote>
<xsl:value-of select="."/>
</blockquote>
</xsl:template>
<xsl:template match="A">
<A>
<xsl:attribute name="href">
<xsl:value-of select="@href"/>
</xsl:attribute>
<xsl:value-of select="."/>
</A>
</xsl:template>
</xsl:stylesheet>
--
Devenez redacteur <XML>fr et contribuez au developpement du
xml francophone (http://xmlfr.org/infos/redacteurs/) !
Liste de diffusion "xml-tech@xmlfr.org" (http://xmlfr.org).
Cette liste est a votre disposition pour discuter en francais de
tout sujet technique lie a XML.
Pour resilier votre abonnement, envoyez un message contenant
la commande "unsubscribe" a xml-tech-request@xmlfr.org
(mailto:xml-tech-request@xmlfr.org?Subject=unsubscribe)
Archive générée par hypermail 2.1.3 le 28/06/2004 - 11:05 UTC
webmaster@xmlfr.org
|