HI All,
I want to create un XML file that contains it's XSL style sheet so i do not need to refer an extern XSL style sheet.
Any help or examlpe.
Thanks.
ie: i 've tried this example, any correction is wellcome!
[COLOR=red yellow]
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="#style" type="text/xsl"?>
<PG>
<xsl:stylesheet id="style" version="1.0"
xmlns:xsl=" >
<xsl:template match="/">
<html>
<body>
<h2 align="center">TITLE</h2>
<table border="0">
<tr bgcolor="#9acd32">
<th align="left">Date de Presentation </th>
<th align="left">Poste de Base </th>
<th align="left">Poste De Rattachement </th>
<th align="left">Montant </th>
<th align="left">Objet Depense </th>
</tr>
<xsl:for-each select="PG/L">
<xsl:if test="position() mod 2=0">
<tr bgcolor="#FFCC66">
<td><xsl:value-of select="date_presentation" /></td>
<td><xsl:value-of select="poste_base" /></td>
<td><xsl:value-of select="poste_rattachement" /></td>
<td><xsl:value-of select="montant" /></td>
<td><xsl:value-of select="objet_depense" /></td>
</tr>
</xsl:if>
<xsl:if test="(position() mod 2)!=0">
<tr bgcolor="#66CC00">
<td><xsl:value-of select="date_presentation" /></td>
<td><xsl:value-of select="poste_base" /></td>
<td><xsl:value-of select="poste_rattachement" /></td>
<td><xsl:value-of select="montant" /></td>
<td><xsl:value-of select="objet_depense" /></td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="xsl:stylesheet"/>
</xsl:stylesheet>
<L>
<date_presentation>02/03/2009</date_presentation><poste_base>1060</poste_base><poste_rattachement>1060</poste_rattachement><montant>2011.76</montant><rubrique>121102000091001030 </rubrique><objet_depense>SALAIRE DU MOIS DE FEVRIER 2009 DOMAINE DES PECHES MARITIMES </objet_depense>
</L>
</PG>
[/color]
I want to create un XML file that contains it's XSL style sheet so i do not need to refer an extern XSL style sheet.
Any help or examlpe.
Thanks.
ie: i 've tried this example, any correction is wellcome!
[COLOR=red yellow]
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="#style" type="text/xsl"?>
<PG>
<xsl:stylesheet id="style" version="1.0"
xmlns:xsl=" >
<xsl:template match="/">
<html>
<body>
<h2 align="center">TITLE</h2>
<table border="0">
<tr bgcolor="#9acd32">
<th align="left">Date de Presentation </th>
<th align="left">Poste de Base </th>
<th align="left">Poste De Rattachement </th>
<th align="left">Montant </th>
<th align="left">Objet Depense </th>
</tr>
<xsl:for-each select="PG/L">
<xsl:if test="position() mod 2=0">
<tr bgcolor="#FFCC66">
<td><xsl:value-of select="date_presentation" /></td>
<td><xsl:value-of select="poste_base" /></td>
<td><xsl:value-of select="poste_rattachement" /></td>
<td><xsl:value-of select="montant" /></td>
<td><xsl:value-of select="objet_depense" /></td>
</tr>
</xsl:if>
<xsl:if test="(position() mod 2)!=0">
<tr bgcolor="#66CC00">
<td><xsl:value-of select="date_presentation" /></td>
<td><xsl:value-of select="poste_base" /></td>
<td><xsl:value-of select="poste_rattachement" /></td>
<td><xsl:value-of select="montant" /></td>
<td><xsl:value-of select="objet_depense" /></td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="xsl:stylesheet"/>
</xsl:stylesheet>
<L>
<date_presentation>02/03/2009</date_presentation><poste_base>1060</poste_base><poste_rattachement>1060</poste_rattachement><montant>2011.76</montant><rubrique>121102000091001030 </rubrique><objet_depense>SALAIRE DU MOIS DE FEVRIER 2009 DOMAINE DES PECHES MARITIMES </objet_depense>
</L>
</PG>
[/color]