Xslt
Fermé
adas
Messages postés
7
Date d'inscription
mardi 13 février 2007
Statut
Membre
Dernière intervention
22 février 2007
-
14 févr. 2007 à 01:34
adas Messages postés 7 Date d'inscription mardi 13 février 2007 Statut Membre Dernière intervention 22 février 2007 - 22 févr. 2007 à 15:02
adas Messages postés 7 Date d'inscription mardi 13 février 2007 Statut Membre Dernière intervention 22 février 2007 - 22 févr. 2007 à 15:02
8 réponses
Reivax962
Messages postés
3672
Date d'inscription
jeudi 16 juin 2005
Statut
Membre
Dernière intervention
11 février 2021
1 011
14 févr. 2007 à 10:23
14 févr. 2007 à 10:23
Bonjour,
Je ne comprends pas quel langage tu utilises. C'est du XSL, non ? Alors pourquoi tes balises commencent par <xml: ? Y a un truc que je ne comprends pas, là.
Enfin, dans l'hypothèse où tu fais bien du xsl, voilà la solution que j'aurais choisie :
Bon courage,
Xavier
Je ne comprends pas quel langage tu utilises. C'est du XSL, non ? Alors pourquoi tes balises commencent par <xml: ? Y a un truc que je ne comprends pas, là.
Enfin, dans l'hypothèse où tu fais bien du xsl, voilà la solution que j'aurais choisie :
<xsl:template match="fichier.image"> <img src="/TEST/images/{.}" alt="L'image n'a pas pu être affichée" title="Ceci est une image" /> </xsl:template>
Bon courage,
Xavier
adas
Messages postés
7
Date d'inscription
mardi 13 février 2007
Statut
Membre
Dernière intervention
22 février 2007
14 févr. 2007 à 19:25
14 févr. 2007 à 19:25
Tu as complètement raison, c'est du xml. Mais le script ne fonctionne pas. J'explique.
<xsl:template match="fichier.image" >
<img><xsl:attribute name="src">/test/images/<xsl:value-of select="."/></xsl:attribute>
</img>
</xsl:template> -->
Le "fichier.image", viens d'une base de données msql, fichier.image est l'endroit où j'ajoute l'image. Dans la base de données, le "alt" est dans un autre endroit qui s'appelle dc.rights. Lorsque j'utilise le script ci-haut j'obtiens les bonnes images et à la bonne place, il y a plusieurs images. Maintenant, je dois ajouter le "alt" et eux aussi, sont différents et dépende de l'image.
J'ai tout essayer, pour ajouter le "alt" et rien ne va. Cependant, si
<xsl:template match="fichier.image" >
<img alt="*"><xsl:attribute name="src">/test/images/<xsl:value-of select="."/></xsl:attribute>
</img>
</xsl:template> -->
J'obtiens comme equivalent de texte "*". Il faut que je trouve une façon d'ajouter le "alt", tel que la façon que j'ajoute l'image? Mais bon, je cherche encore. Merci pour ton aide!
<xsl:template match="fichier.image" >
<img><xsl:attribute name="src">/test/images/<xsl:value-of select="."/></xsl:attribute>
</img>
</xsl:template> -->
Le "fichier.image", viens d'une base de données msql, fichier.image est l'endroit où j'ajoute l'image. Dans la base de données, le "alt" est dans un autre endroit qui s'appelle dc.rights. Lorsque j'utilise le script ci-haut j'obtiens les bonnes images et à la bonne place, il y a plusieurs images. Maintenant, je dois ajouter le "alt" et eux aussi, sont différents et dépende de l'image.
J'ai tout essayer, pour ajouter le "alt" et rien ne va. Cependant, si
<xsl:template match="fichier.image" >
<img alt="*"><xsl:attribute name="src">/test/images/<xsl:value-of select="."/></xsl:attribute>
</img>
</xsl:template> -->
J'obtiens comme equivalent de texte "*". Il faut que je trouve une façon d'ajouter le "alt", tel que la façon que j'ajoute l'image? Mais bon, je cherche encore. Merci pour ton aide!
Reivax962
Messages postés
3672
Date d'inscription
jeudi 16 juin 2005
Statut
Membre
Dernière intervention
11 février 2021
1 011
15 févr. 2007 à 10:29
15 févr. 2007 à 10:29
Bonjour,
Il faudrait voir comment tu rappatries les données de ta base, et par exemple, tu pourrais récupérer le alt dans ton fichier XML comme suit :
<fichier.image alt="texte de l'image">image1.jpg</fichier.image>
Ensuite, dans ton XSL, il suffira de mettre :
Il faudrait voir comment tu rappatries les données de ta base, et par exemple, tu pourrais récupérer le alt dans ton fichier XML comme suit :
<fichier.image alt="texte de l'image">image1.jpg</fichier.image>
Ensuite, dans ton XSL, il suffira de mettre :
<xsl:template match="fichier.image" > <img> <xsl:attribute name="src">/test/images/<xsl:value-of select="."/></xsl:attribute> <xsl:attribute name="alt"><xsl:value-of select="@alt"/></xsl:attribute> </img> </xsl:template>
adas
Messages postés
7
Date d'inscription
mardi 13 février 2007
Statut
Membre
Dernière intervention
22 février 2007
15 févr. 2007 à 12:54
15 févr. 2007 à 12:54
Merci!
Je vais essayer et t'en donner des nouvelles!
Je vais essayer et t'en donner des nouvelles!
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
adas
Messages postés
7
Date d'inscription
mardi 13 février 2007
Statut
Membre
Dernière intervention
22 février 2007
20 févr. 2007 à 19:51
20 févr. 2007 à 19:51
Malheureusement ça ne fonctionne pas.
Si j'utilise
<xsl:template match="test.image" >
<img><xsl:attribute name="src">/TEST/images/<xsl:value-of select="."/></xsl:attribute>
<xsl:attribute name="alt">/TEST/images/<xsl:value-of select="@alt"/></xsl:attribute>
</img>
</xsl:template>
Le texte suivant apparaît. /TEST/images/
Par contre, si j'utilise
<xsl:template match="chp.image" >
<img><xsl:attribute name="src">/CHP/images/<xsl:value-of select="."/></xsl:attribute>
<xsl:attribute name="alt">/CHP/images/<xsl:value-of select="."/></xsl:attribute>
</img>
</xsl:template>
Le texte suivant s'affiche: /TEST/images/newimage_e.gif
La deuxième méthode est meilleure car elle affiche la bonne image mais comment faire pour faire afficher le "alt" qui fait partie de cette dites image?
Quelqu'un a une idée!
Merci!
Si j'utilise
<xsl:template match="test.image" >
<img><xsl:attribute name="src">/TEST/images/<xsl:value-of select="."/></xsl:attribute>
<xsl:attribute name="alt">/TEST/images/<xsl:value-of select="@alt"/></xsl:attribute>
</img>
</xsl:template>
Le texte suivant apparaît. /TEST/images/
Par contre, si j'utilise
<xsl:template match="chp.image" >
<img><xsl:attribute name="src">/CHP/images/<xsl:value-of select="."/></xsl:attribute>
<xsl:attribute name="alt">/CHP/images/<xsl:value-of select="."/></xsl:attribute>
</img>
</xsl:template>
Le texte suivant s'affiche: /TEST/images/newimage_e.gif
La deuxième méthode est meilleure car elle affiche la bonne image mais comment faire pour faire afficher le "alt" qui fait partie de cette dites image?
Quelqu'un a une idée!
Merci!
Reivax962
Messages postés
3672
Date d'inscription
jeudi 16 juin 2005
Statut
Membre
Dernière intervention
11 février 2021
1 011
21 févr. 2007 à 10:10
21 févr. 2007 à 10:10
Bonjour,
Le XSL est un langage qui permet de transformer un document XML en un autre document XML (habituellement, du XHTML).
Si tu ne donnes pas la structure de ton document XML d'entrée, on ne pourra pas t'aider convenablement.
Xavier
Le XSL est un langage qui permet de transformer un document XML en un autre document XML (habituellement, du XHTML).
Si tu ne donnes pas la structure de ton document XML d'entrée, on ne pourra pas t'aider convenablement.
Xavier
adas
Messages postés
7
Date d'inscription
mardi 13 février 2007
Statut
Membre
Dernière intervention
22 février 2007
21 févr. 2007 à 14:06
21 févr. 2007 à 14:06
Est-ce que ça aide?
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp " ">
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" exclude-result-prefixes="rdf" version="1.0">
<xsl:output indent="yes" method="html" omit-xml-declaration="yes" />
<xsl:param name="itemdisplayed" select="number(15)" />
<xsl:param name="showdescription" select="'false'" />
<xsl:param name="showtitle" select="'false'" />
<xsl:param name="showtextinput" select="'true'" />
<xsl:param name="showpublisher" select="'true'" />
<!-- Parameterized URLs are hidden from Google. This is what we use internally.
<xsl:param name="baseurle" select="'/TEST/index_e.jsp?pageid=4005&odp='" />
<xsl:param name="baseurlf" select="'/TEST/index_f.jsp?pageid=4005&odp='" />
But this is what we publish. They are translated back to internal form by a
Tomcat filter.-->
<xsl:param name="baseurle" select="'/TEST/index_e.jsp/pageid/4005/odp/'" />
<xsl:param name="baseurlf" select="'/TEST/index_f.jsp/pageid/4005/odp/'" />
<!-- GS 2005 04 18 modified home URLS to make them simple URLs -->
<xsl:param name="homeurle" select="'/TEST/index_e.jsp'" />
<xsl:param name="homeurlf" select="'/TEST/index_f.jsp'" />
<!-- DO NOT SHOW THESE CATEGORIES -->
<xsl:param name="focusaboriginal">Top/Health/Aboriginal_Peoples</xsl:param>
<xsl:param name="focuschildren">Top/Health/Children</xsl:param>
<xsl:param name="focusmen">Top/Health/Men</xsl:param>
<xsl:param name="focusnoncanadians">Top/Health/Non-Canadians</xsl:param>
<xsl:param name="focusseniors">Top/Health/Seniors</xsl:param>
<xsl:param name="focusveterans">Top/Health/Veterans</xsl:param>
<xsl:param name="focuswomen">Top/Health/Women</xsl:param>
<xsl:param name="focusyouth">Top/Health/Youth</xsl:param>
<xsl:param name="focusodps" select="concat( $focusaboriginal, ' ', $focuschildren, ' ', $focusmen, ' ', $focusnoncanadians, ' ',
$focusseniors, ' ', $focusveterans, ' ', $focuswomen, ' ', $focusyouth)" />
<xsl:template match="chp.odpcategory">
<xsl:variable name="title" select="title" />
<xsl:variable name="test" select="test" />
<!-- dh 2004 01 28
Don't display the canned descriptions for the "focus categories".
We now use the ones stored in the database.
<xsl:if test="contains($focusodps,@chp.odp)">
<xsl:choose>
<xsl:when test="(//dc.language='en')">
<xsl:call-template name="showfocusdescription_e" />
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="showfocusdescription_f" />
</xsl:otherwise>
</xsl:choose>
</xsl:if>
-->
<!-- Show breadcrumb trail and Category Description only if the category
is not Top/Health" -->
<xsl:if test="(@chp.odp != 'Top/Health')">
<hr size="1" />
<xsl:apply-templates select="chp.breadcrumbs" />
<h3> <xsl:value-of select="description" /> </h3>
<xsl:if test="$showtitle = 'true' and $title">
<br />
<xsl:value-of select="title" />
</xsl:if>
<!-- <hr size="1" /> -->
<br />
</xsl:if>
<!-- process folders, if any-->
<xsl:if test="subcategory">
<!--Put in columns, if more than one-->
<xsl:choose>
<xsl:when test="count(//subcategory) = 1">
<xsl:apply-templates select="subcategory" mode="one" />
<hr size="1" />
</xsl:when>
<xsl:otherwise>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="top" width="50%">
<xsl:apply-templates select="subcategory" mode="left" />
</td>
<td valign="top" width="50%">
<xsl:apply-templates select="subcategory" mode="right" />
</td>
</tr>
</table>
<hr size="1" />
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:apply-templates select="item">
<!-- sort on title alphabetically within rank -->
<xsl:sort select="chp.rank" /><xsl:sort select="title" />
</xsl:apply-templates>
</xsl:template><!-- chp.odpcategory -->
<!-- dh Re breadcrumbs. This code appears to remove Top from Top>Health and also
to set up link on Health to point to special static page instead of dynamically
genererated list of subcategories without associated descriptions, etc.
-->
<xsl:template match="chp.breadcrumbs">
<H1><xsl:apply-templates select="chp.breadcrumb[position()!=1]" /></H1>
<xsl:if test="contains(//@chp.odp,'Top/Health/Conditions_and_Diseases') and //@dc.language='en'">
<P>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#A" class="crumbtrail" style="font-size: 1.7em;">A</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#B" class="crumbtrail" style="font-size: 1.7em;">B</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#C" class="crumbtrail" style="font-size: 1.7em;">C</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#D" class="crumbtrail" style="font-size: 1.7em;">D</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#E" class="crumbtrail" style="font-size: 1.7em;">E</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#F" class="crumbtrail" style="font-size: 1.7em;">F</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#G" class="crumbtrail" style="font-size: 1.7em;">G</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#H" class="crumbtrail" style="font-size: 1.7em;">H</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#I" class="crumbtrail" style="font-size: 1.7em;">I</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#J" class="crumbtrail" style="font-size: 1.7em;">J</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#K" class="crumbtrail" style="font-size: 1.7em;">K</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#L" class="crumbtrail" style="font-size: 1.7em;">L</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#M" class="crumbtrail" style="font-size: 1.7em;">M</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#N" class="crumbtrail" style="font-size: 1.7em;">N</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#O" class="crumbtrail" style="font-size: 1.7em;">O</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#P" class="crumbtrail" style="font-size: 1.7em;">P</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#Q" class="crumbtrail" style="font-size: 1.7em;">Q</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#R" class="crumbtrail" style="font-size: 1.7em;">R</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#S" class="crumbtrail" style="font-size: 1.7em;">S</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#T" class="crumbtrail" style="font-size: 1.7em;">T</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#U" class="crumbtrail" style="font-size: 1.7em;">U</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#V" class="crumbtrail" style="font-size: 1.7em;">V</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#W" class="crumbtrail" style="font-size: 1.7em;">W</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#X" class="crumbtrail" style="font-size: 1.7em;">X</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#Y" class="crumbtrail" style="font-size: 1.7em;">Y</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#Z" class="crumbtrail" style="font-size: 1.7em;">Z</a>
</P>
</xsl:if>
<xsl:if test="contains(//@chp.odp,'Top/Health/Conditions_and_Diseases') and //@dc.language='fr'">
<P>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#A" class="crumbtrail" style="font-size: 1.7em;">A</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#B" class="crumbtrail" style="font-size: 1.7em;">B</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#C" class="crumbtrail" style="font-size: 1.7em;">C</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#D" class="crumbtrail" style="font-size: 1.7em;">D</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#E" class="crumbtrail" style="font-size: 1.7em;">E</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#F" class="crumbtrail" style="font-size: 1.7em;">F</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#G" class="crumbtrail" style="font-size: 1.7em;">G</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#H" class="crumbtrail" style="font-size: 1.7em;">H</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#I" class="crumbtrail" style="font-size: 1.7em;">I</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#J" class="crumbtrail" style="font-size: 1.7em;">J</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#K" class="crumbtrail" style="font-size: 1.7em;">K</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#L" class="crumbtrail" style="font-size: 1.7em;">L</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#M" class="crumbtrail" style="font-size: 1.7em;">M</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#N" class="crumbtrail" style="font-size: 1.7em;">N</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#O" class="crumbtrail" style="font-size: 1.7em;">O</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#P" class="crumbtrail" style="font-size: 1.7em;">P</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#Q" class="crumbtrail" style="font-size: 1.7em;">Q</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#R" class="crumbtrail" style="font-size: 1.7em;">R</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#S" class="crumbtrail" style="font-size: 1.7em;">S</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#T" class="crumbtrail" style="font-size: 1.7em;">T</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#U" class="crumbtrail" style="font-size: 1.7em;">U</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#V" class="crumbtrail" style="font-size: 1.7em;">V</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#W" class="crumbtrail" style="font-size: 1.7em;">W</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#X" class="crumbtrail" style="font-size: 1.7em;">X</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#Y" class="crumbtrail" style="font-size: 1.7em;">Y</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#Z" class="crumbtrail" style="font-size: 1.7em;">Z</a>
</P>
</xsl:if>
</xsl:template>
<!-- dh Hmm not yet sure what this is for -->
<xsl:template match="description">
<xsl:value-of select="description" />
</xsl:template>
<!-- dh
This is code that formats the main breadcrumb trail.
As at January 28, 2004 this is the second one, below "Targeting Health"
Might be able to reduce code herere French/English
e.g. use new vars $homeurlx=either homeurle or holeurlf
and same for $baseurlx
-->
<xsl:template match="chp.breadcrumb[position()!=1]">
<xsl:choose>
<xsl:when test="position()!=count(//chp.breadcrumb[position()!=1])">
<xsl:if test="(@dc.language='en')">
<xsl:choose>
<xsl:when test="(position()=1)">
<a href="{$homeurle}" class="crumbtrail">
<xsl:value-of select="." />
</a> >
</xsl:when>
<xsl:otherwise>
<a href="{$baseurle}{@chp.breadcrumb.link}" class="crumbtrail">
<xsl:value-of select="." />
</a> >
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="(@dc.language='fr')">
<xsl:choose>
<xsl:when test="(position()=1)">
<a href="{$homeurlf}" class="crumbtrail">
<xsl:value-of select="." />
</a> >
</xsl:when>
<xsl:otherwise>
<a href="{$baseurlf}{@chp.breadcrumb.link}" class="crumbtrail">
<xsl:value-of select="." />
</a> >
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:when>
<xsl:when test="position()=count(//chp.breadcrumb[position()!=1])">
<span class="crumbterminal">
<xsl:value-of select="." />
</span>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="subcategory" mode="one">
<!-- CREATING SINGLE COLUMN OF SUBCATEGORIES -->
<xsl:if test="(dc.language='en')">
<img src="/TEST/images/folder.gif" width="8" height="7" alt="+" />
<a href="{$baseurle}{link}" class="odp">
<xsl:value-of select="title" />
</a>
<br />
</xsl:if>
<xsl:if test="(dc.language='fr')">
<img src="/TEST/images/folder.gif" width="8" height="7" alt="+" />
<a href="{$baseurlf}{link}" class="odp">
<xsl:value-of select="title" />
</a>
<br />
</xsl:if>
</xsl:template>
<xsl:template match="subcategory" mode="left">
<xsl:variable name="halfCount" select="count(//subcategory) mod 2 + count(//subcategory) div 2" />
<xsl:if test="position() <= $halfCount">
<!-- CREATING LEFT COLUMN OF SUBCATEGORIES -->
<!-- Filter out subcategories that are under a Focus topic -->
<xsl:if test="not(contains($focusodps,link))">
<table cellspacing="0" cellpadding="3" border="0">
<tr><xsl:if test="(dc.language='en')">
<td> <img src="/TEST/images/folder.gif" width="8" height="7" alt="+" /> </td>
<td align="left"><a href="{$baseurle}{link}" class="odp"><xsl:value-of select="title" /></a></td>
</xsl:if>
<xsl:if test="(dc.language='fr')">
<td> <img src="/TEST/images/folder.gif" width="8" height="7" alt="+" /> </td>
<td align="left"><a href="{$baseurlf}{link}" class="odp"><xsl:value-of select="title" /></a></td>
</xsl:if></tr>
</table>
</xsl:if><!-- End of filter -->
</xsl:if>
</xsl:template>
<xsl:template match="subcategory" mode="right">
<xsl:variable name="halfCount" select="count(//subcategory) mod 2 + count(//subcategory) div 2" />
<xsl:if test="position() > $halfCount">
<!-- CREATING RIGHT COLUMN OF SUBCATEGORIES -->
<!-- Filter out subcategories that are under a Focus topic -->
<xsl:if test="not(contains($focusodps,link))">
<table cellspacing="0" cellpadding="3" border="0">
<tr><xsl:if test="(dc.language='en')">
<td> <img src="/TEST/images/folder.gif" width="8" height="7" alt="+" /> </td>
<td align="left"><a href="{$baseurle}{link}" class="odp"><xsl:value-of select="title" /></a></td>
</xsl:if>
<xsl:if test="(dc.language='fr')">
<td> <img src="/TEST/images/folder.gif" width="8" height="7" alt="+" /> </td>
<td align="left"><a href="{$baseurlf}{link}" class="odp"><xsl:value-of select="title" /></a></td>
</xsl:if></tr>
</table>
</xsl:if><!-- End of filter -->
</xsl:if>
</xsl:template>
<!-- Generate title, description, source for a resource -->
<xsl:template match="item">
<!-- <h4><a href="{link}" class="itemtitle" target="_blank"><xsl:value-of select="title" />(rank=<xsl:value-of select="chp.rank" />)</a> </h4>-->
<!-- <h4><a href="{link}" class="itemtitle"><xsl:value-of select="title" /> (rank=<xsl:value-of select="chp.rank" />)</a> </h4>-->
<!-- <h4><a href="{link}" class="itemtitle" target="_blank"><xsl:value-of select="title" /></a> </h4> -->
<!-- gs 12 14 2005 modified to call page forwarding
This is to capture page ranks.
The page forward script does not work with our own
pages so we don't want to use page forwarding.
Have to detect ***See Also resources
-->
<xsl:choose>
<xsl:when test = "../@chp.odp = 'Top/Health/Conditions_and_Diseases/Flu' or ../@chp.odp = 'Top/Health/Addictions/Drugs' or contains(../@chp.odp, 'Top/Health/Youth') or contains(../@chp.odp , 'Top/Health/Healthy_Lifestyles')
or contains(../@chp.odp , 'Top/Health/Conditions_and_Diseases') or contains(../@chp.odp , 'Top/Health/Travel') or contains(../@chp.odp , 'Top/Health/Health_Care') or contains(../@chp.odp , 'Top/Health/Children')
or contains(../@chp.odp , 'Top/Health/Mental_Health') ">
<xsl:if test = "not(contains(translate(title,'sealo','SEALO'),'SEE ALSO')) and not(contains(translate(title,'Voir aussi','VOIR AUSSI'),'VOIR AUSSI'))">
<h4><a href="/TEST/PageFrwd.jsp?r={chp.rank}&p={../@chp.odp}&ID={link}" class="itemtitle" target="_blank"><xsl:value-of select="title" /></a> </h4>
</xsl:if>
<xsl:if test = "contains(translate(title,'sealo','SEALO'),'SEE ALSO') or (contains(translate(title,'voiraus','VOIRAUS'),'VOIR AUSSI'))">
<h4><a href="{link}" class="itemtitle" target="_blank"><xsl:value-of select="title" /> </a> </h4>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<h4><a href="{link}" class="itemtitle" target="_blank"><xsl:value-of select="title" /> </a> </h4>
</xsl:otherwise>
</xsl:choose>
<span class="itemdesc">
<xsl:value-of select="description" />
<br />
<xsl:apply-templates select="chp.image" />
<xsl:if test="$showpublisher= 'true'">
<span style="font-style: italic;"> Source: <xsl:value-of select="chp.publisher" /></span>
</xsl:if>
</span>
</xsl:template>
<xsl:template match="chp.image" >
<img><xsl:attribute name="src">/TEST/images/<xsl:value-of select="."/></xsl:attribute>
</img>
</xsl:template>
<!-- dh 2004 01 28 should not need this anymore
<xsl:template name="showfocusdescription_e">
<xsl:if test="(@chp.odp = $focusaboriginal)">
<p style="color: #000088;">The Canada Health Portal (CHP) contains information relevant to the health and wellness of Aboriginals Peoples. Here you will find direct and easy access to health care information to help Aboriginals stay healthy and improve their quality of life.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focuschildren)">
<p style="color: #000088;">The Canada Health Portal (CHP) contains information relevant to the health and wellness of children. Here you will find direct and easy access to health care information to help children stay healthy and improve their quality of life.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focusmen)">
<p style="color: #000088;">The Canada Health Portal (CHP) contains information relevant to the health and wellness of men. Here you will find direct and easy access to health care information to help men stay healthy and improve their quality of life.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focusnoncanadians)">
<p style="color: #000088;">The Canada Health Portal (CHP) contains information relevant to the health and wellness of non-Canadians. Here you will find direct and easy access to health care information to help non-Canadians stay healthy and improve their quality of life.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focusseniors)">
<p style="color: #000088;">The Canada Health Portal (CHP) contains information relevant to the health and wellness of seniors. Here you will find direct and easy access to health care information to help seniors stay healthy and improve their quality of life.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focusveterans)">
<p style="color: #000088;">The Canada Health Portal (CHP) contains information relevant to the health and wellness of veterans. Here you will find direct and easy access to health care information to help veterans stay healthy and improve their quality of life.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focuswomen)">
<p style="color: #000088;">The Canada Health Portal (CHP) contains information relevant to the health and wellness of women. Here you will find direct and easy access to health care information to help women stay healthy and improve their quality of life.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focusyouth)">
<p style="color: #000088;">The Canada Health Portal (CHP) contains information relevant to the health and wellness of youth. Here you will find direct and easy access to health care information to help today's youth stay healthy and improve their quality of life.</p>
</xsl:if>
</xsl:template>
<xsl:template name="showfocusdescription_f">
<xsl:if test="(@chp.odp = $focusaboriginal)">
<p style="color: #000088;">Le Portail canadien sur la santé contient de l'information relative à la santé et au bien-être des peuples autochtones. Voici un accès direct et facile à de l'information sur les soins de santé visant à aider les Autochtones à demeurer en santé et à améliorer leur qualité de vie.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focuschildren)">
<p style="color: #000088;">Le Portail canadien sur la santé contient de l'information relative à la santé et au bien-être des enfants. Voici un accès direct et facile à de l'information sur les soins de santé visant à aider les enfants à demeurer en santé et à améliorer leur qualité de vie.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focusmen)">
<p style="color: #000088;">Le Portail canadien sur la santé contient de l'information relative à la santé et au bien-être des hommes. Voici un accès direct et facile à de l'information sur les soins de santé visant à aider les hommes à demeurer en santé et à améliorer leur qualité de vie.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focusnoncanadians)">
<p style="color: #000088;">Le Portail canadien sur la santé contient de l'information relative à la santé et au bien-être des non-Canadiens. Il donne rapidement et facilement accès à des renseignements sur les soins de santé en vue d’aider les non-Canadiens à demeurer en bonne santé et à améliorer leur qualité de vie.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focusseniors)">
<p style="color: #000088;">Le Portail canadien sur la santé contient de l'information relative à la santé et au bien-être des aînés. Voici un accès direct et facile à de l'information sur les soins de santé visant à aider les aînés à demeurer en santé et à améliorer leur qualité de vie.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focusveterans)">
<p style="color: #000088;">Le Portail canadien sur la santé contient de l'information relative à la santé et au bien-être des anciens combattants. Voici un accès direct et facile à de l'information sur les soins de santé visant à aider les anciens combattants à demeurer en santé et à améliorer leur qualité de vie.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focuswomen)">
<p style="color: #000088;">Le Portail canadien sur la santé contient de l'information relative à la santé et au bien-être des femmes. Voici un accès direct et facile à de l'information sur les soins de santé visant à aider les femmes à demeurer en santé et à améliorer leur qualité de vie.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focusyouth)">
<p style="color: #000088;">Le Portail canadien sur la santé contient de l'information relative à la santé et au bien-être de la jeunesse. Voici un accès direct et facile à de l'information sur les soins de santé visant à aider les jeunes d'aujourd'hui à demeurer en santé et à améliorer leur qualité de vie.</p>
</xsl:if>
</xsl:template>
-->
</xsl:stylesheet>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp " ">
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" exclude-result-prefixes="rdf" version="1.0">
<xsl:output indent="yes" method="html" omit-xml-declaration="yes" />
<xsl:param name="itemdisplayed" select="number(15)" />
<xsl:param name="showdescription" select="'false'" />
<xsl:param name="showtitle" select="'false'" />
<xsl:param name="showtextinput" select="'true'" />
<xsl:param name="showpublisher" select="'true'" />
<!-- Parameterized URLs are hidden from Google. This is what we use internally.
<xsl:param name="baseurle" select="'/TEST/index_e.jsp?pageid=4005&odp='" />
<xsl:param name="baseurlf" select="'/TEST/index_f.jsp?pageid=4005&odp='" />
But this is what we publish. They are translated back to internal form by a
Tomcat filter.-->
<xsl:param name="baseurle" select="'/TEST/index_e.jsp/pageid/4005/odp/'" />
<xsl:param name="baseurlf" select="'/TEST/index_f.jsp/pageid/4005/odp/'" />
<!-- GS 2005 04 18 modified home URLS to make them simple URLs -->
<xsl:param name="homeurle" select="'/TEST/index_e.jsp'" />
<xsl:param name="homeurlf" select="'/TEST/index_f.jsp'" />
<!-- DO NOT SHOW THESE CATEGORIES -->
<xsl:param name="focusaboriginal">Top/Health/Aboriginal_Peoples</xsl:param>
<xsl:param name="focuschildren">Top/Health/Children</xsl:param>
<xsl:param name="focusmen">Top/Health/Men</xsl:param>
<xsl:param name="focusnoncanadians">Top/Health/Non-Canadians</xsl:param>
<xsl:param name="focusseniors">Top/Health/Seniors</xsl:param>
<xsl:param name="focusveterans">Top/Health/Veterans</xsl:param>
<xsl:param name="focuswomen">Top/Health/Women</xsl:param>
<xsl:param name="focusyouth">Top/Health/Youth</xsl:param>
<xsl:param name="focusodps" select="concat( $focusaboriginal, ' ', $focuschildren, ' ', $focusmen, ' ', $focusnoncanadians, ' ',
$focusseniors, ' ', $focusveterans, ' ', $focuswomen, ' ', $focusyouth)" />
<xsl:template match="chp.odpcategory">
<xsl:variable name="title" select="title" />
<xsl:variable name="test" select="test" />
<!-- dh 2004 01 28
Don't display the canned descriptions for the "focus categories".
We now use the ones stored in the database.
<xsl:if test="contains($focusodps,@chp.odp)">
<xsl:choose>
<xsl:when test="(//dc.language='en')">
<xsl:call-template name="showfocusdescription_e" />
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="showfocusdescription_f" />
</xsl:otherwise>
</xsl:choose>
</xsl:if>
-->
<!-- Show breadcrumb trail and Category Description only if the category
is not Top/Health" -->
<xsl:if test="(@chp.odp != 'Top/Health')">
<hr size="1" />
<xsl:apply-templates select="chp.breadcrumbs" />
<h3> <xsl:value-of select="description" /> </h3>
<xsl:if test="$showtitle = 'true' and $title">
<br />
<xsl:value-of select="title" />
</xsl:if>
<!-- <hr size="1" /> -->
<br />
</xsl:if>
<!-- process folders, if any-->
<xsl:if test="subcategory">
<!--Put in columns, if more than one-->
<xsl:choose>
<xsl:when test="count(//subcategory) = 1">
<xsl:apply-templates select="subcategory" mode="one" />
<hr size="1" />
</xsl:when>
<xsl:otherwise>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="top" width="50%">
<xsl:apply-templates select="subcategory" mode="left" />
</td>
<td valign="top" width="50%">
<xsl:apply-templates select="subcategory" mode="right" />
</td>
</tr>
</table>
<hr size="1" />
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:apply-templates select="item">
<!-- sort on title alphabetically within rank -->
<xsl:sort select="chp.rank" /><xsl:sort select="title" />
</xsl:apply-templates>
</xsl:template><!-- chp.odpcategory -->
<!-- dh Re breadcrumbs. This code appears to remove Top from Top>Health and also
to set up link on Health to point to special static page instead of dynamically
genererated list of subcategories without associated descriptions, etc.
-->
<xsl:template match="chp.breadcrumbs">
<H1><xsl:apply-templates select="chp.breadcrumb[position()!=1]" /></H1>
<xsl:if test="contains(//@chp.odp,'Top/Health/Conditions_and_Diseases') and //@dc.language='en'">
<P>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#A" class="crumbtrail" style="font-size: 1.7em;">A</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#B" class="crumbtrail" style="font-size: 1.7em;">B</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#C" class="crumbtrail" style="font-size: 1.7em;">C</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#D" class="crumbtrail" style="font-size: 1.7em;">D</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#E" class="crumbtrail" style="font-size: 1.7em;">E</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#F" class="crumbtrail" style="font-size: 1.7em;">F</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#G" class="crumbtrail" style="font-size: 1.7em;">G</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#H" class="crumbtrail" style="font-size: 1.7em;">H</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#I" class="crumbtrail" style="font-size: 1.7em;">I</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#J" class="crumbtrail" style="font-size: 1.7em;">J</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#K" class="crumbtrail" style="font-size: 1.7em;">K</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#L" class="crumbtrail" style="font-size: 1.7em;">L</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#M" class="crumbtrail" style="font-size: 1.7em;">M</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#N" class="crumbtrail" style="font-size: 1.7em;">N</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#O" class="crumbtrail" style="font-size: 1.7em;">O</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#P" class="crumbtrail" style="font-size: 1.7em;">P</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#Q" class="crumbtrail" style="font-size: 1.7em;">Q</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#R" class="crumbtrail" style="font-size: 1.7em;">R</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#S" class="crumbtrail" style="font-size: 1.7em;">S</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#T" class="crumbtrail" style="font-size: 1.7em;">T</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#U" class="crumbtrail" style="font-size: 1.7em;">U</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#V" class="crumbtrail" style="font-size: 1.7em;">V</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#W" class="crumbtrail" style="font-size: 1.7em;">W</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#X" class="crumbtrail" style="font-size: 1.7em;">X</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#Y" class="crumbtrail" style="font-size: 1.7em;">Y</a>
<a href="/TEST/index_e.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#Z" class="crumbtrail" style="font-size: 1.7em;">Z</a>
</P>
</xsl:if>
<xsl:if test="contains(//@chp.odp,'Top/Health/Conditions_and_Diseases') and //@dc.language='fr'">
<P>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#A" class="crumbtrail" style="font-size: 1.7em;">A</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#B" class="crumbtrail" style="font-size: 1.7em;">B</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#C" class="crumbtrail" style="font-size: 1.7em;">C</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#D" class="crumbtrail" style="font-size: 1.7em;">D</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#E" class="crumbtrail" style="font-size: 1.7em;">E</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#F" class="crumbtrail" style="font-size: 1.7em;">F</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#G" class="crumbtrail" style="font-size: 1.7em;">G</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#H" class="crumbtrail" style="font-size: 1.7em;">H</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#I" class="crumbtrail" style="font-size: 1.7em;">I</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#J" class="crumbtrail" style="font-size: 1.7em;">J</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#K" class="crumbtrail" style="font-size: 1.7em;">K</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#L" class="crumbtrail" style="font-size: 1.7em;">L</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#M" class="crumbtrail" style="font-size: 1.7em;">M</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#N" class="crumbtrail" style="font-size: 1.7em;">N</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#O" class="crumbtrail" style="font-size: 1.7em;">O</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#P" class="crumbtrail" style="font-size: 1.7em;">P</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#Q" class="crumbtrail" style="font-size: 1.7em;">Q</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#R" class="crumbtrail" style="font-size: 1.7em;">R</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#S" class="crumbtrail" style="font-size: 1.7em;">S</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#T" class="crumbtrail" style="font-size: 1.7em;">T</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#U" class="crumbtrail" style="font-size: 1.7em;">U</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#V" class="crumbtrail" style="font-size: 1.7em;">V</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#W" class="crumbtrail" style="font-size: 1.7em;">W</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#X" class="crumbtrail" style="font-size: 1.7em;">X</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#Y" class="crumbtrail" style="font-size: 1.7em;">Y</a>
<a href="/TEST/index_f.jsp/pageid/4006/az/Top/Health/Conditions_and_Diseases#Z" class="crumbtrail" style="font-size: 1.7em;">Z</a>
</P>
</xsl:if>
</xsl:template>
<!-- dh Hmm not yet sure what this is for -->
<xsl:template match="description">
<xsl:value-of select="description" />
</xsl:template>
<!-- dh
This is code that formats the main breadcrumb trail.
As at January 28, 2004 this is the second one, below "Targeting Health"
Might be able to reduce code herere French/English
e.g. use new vars $homeurlx=either homeurle or holeurlf
and same for $baseurlx
-->
<xsl:template match="chp.breadcrumb[position()!=1]">
<xsl:choose>
<xsl:when test="position()!=count(//chp.breadcrumb[position()!=1])">
<xsl:if test="(@dc.language='en')">
<xsl:choose>
<xsl:when test="(position()=1)">
<a href="{$homeurle}" class="crumbtrail">
<xsl:value-of select="." />
</a> >
</xsl:when>
<xsl:otherwise>
<a href="{$baseurle}{@chp.breadcrumb.link}" class="crumbtrail">
<xsl:value-of select="." />
</a> >
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="(@dc.language='fr')">
<xsl:choose>
<xsl:when test="(position()=1)">
<a href="{$homeurlf}" class="crumbtrail">
<xsl:value-of select="." />
</a> >
</xsl:when>
<xsl:otherwise>
<a href="{$baseurlf}{@chp.breadcrumb.link}" class="crumbtrail">
<xsl:value-of select="." />
</a> >
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:when>
<xsl:when test="position()=count(//chp.breadcrumb[position()!=1])">
<span class="crumbterminal">
<xsl:value-of select="." />
</span>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="subcategory" mode="one">
<!-- CREATING SINGLE COLUMN OF SUBCATEGORIES -->
<xsl:if test="(dc.language='en')">
<img src="/TEST/images/folder.gif" width="8" height="7" alt="+" />
<a href="{$baseurle}{link}" class="odp">
<xsl:value-of select="title" />
</a>
<br />
</xsl:if>
<xsl:if test="(dc.language='fr')">
<img src="/TEST/images/folder.gif" width="8" height="7" alt="+" />
<a href="{$baseurlf}{link}" class="odp">
<xsl:value-of select="title" />
</a>
<br />
</xsl:if>
</xsl:template>
<xsl:template match="subcategory" mode="left">
<xsl:variable name="halfCount" select="count(//subcategory) mod 2 + count(//subcategory) div 2" />
<xsl:if test="position() <= $halfCount">
<!-- CREATING LEFT COLUMN OF SUBCATEGORIES -->
<!-- Filter out subcategories that are under a Focus topic -->
<xsl:if test="not(contains($focusodps,link))">
<table cellspacing="0" cellpadding="3" border="0">
<tr><xsl:if test="(dc.language='en')">
<td> <img src="/TEST/images/folder.gif" width="8" height="7" alt="+" /> </td>
<td align="left"><a href="{$baseurle}{link}" class="odp"><xsl:value-of select="title" /></a></td>
</xsl:if>
<xsl:if test="(dc.language='fr')">
<td> <img src="/TEST/images/folder.gif" width="8" height="7" alt="+" /> </td>
<td align="left"><a href="{$baseurlf}{link}" class="odp"><xsl:value-of select="title" /></a></td>
</xsl:if></tr>
</table>
</xsl:if><!-- End of filter -->
</xsl:if>
</xsl:template>
<xsl:template match="subcategory" mode="right">
<xsl:variable name="halfCount" select="count(//subcategory) mod 2 + count(//subcategory) div 2" />
<xsl:if test="position() > $halfCount">
<!-- CREATING RIGHT COLUMN OF SUBCATEGORIES -->
<!-- Filter out subcategories that are under a Focus topic -->
<xsl:if test="not(contains($focusodps,link))">
<table cellspacing="0" cellpadding="3" border="0">
<tr><xsl:if test="(dc.language='en')">
<td> <img src="/TEST/images/folder.gif" width="8" height="7" alt="+" /> </td>
<td align="left"><a href="{$baseurle}{link}" class="odp"><xsl:value-of select="title" /></a></td>
</xsl:if>
<xsl:if test="(dc.language='fr')">
<td> <img src="/TEST/images/folder.gif" width="8" height="7" alt="+" /> </td>
<td align="left"><a href="{$baseurlf}{link}" class="odp"><xsl:value-of select="title" /></a></td>
</xsl:if></tr>
</table>
</xsl:if><!-- End of filter -->
</xsl:if>
</xsl:template>
<!-- Generate title, description, source for a resource -->
<xsl:template match="item">
<!-- <h4><a href="{link}" class="itemtitle" target="_blank"><xsl:value-of select="title" />(rank=<xsl:value-of select="chp.rank" />)</a> </h4>-->
<!-- <h4><a href="{link}" class="itemtitle"><xsl:value-of select="title" /> (rank=<xsl:value-of select="chp.rank" />)</a> </h4>-->
<!-- <h4><a href="{link}" class="itemtitle" target="_blank"><xsl:value-of select="title" /></a> </h4> -->
<!-- gs 12 14 2005 modified to call page forwarding
This is to capture page ranks.
The page forward script does not work with our own
pages so we don't want to use page forwarding.
Have to detect ***See Also resources
-->
<xsl:choose>
<xsl:when test = "../@chp.odp = 'Top/Health/Conditions_and_Diseases/Flu' or ../@chp.odp = 'Top/Health/Addictions/Drugs' or contains(../@chp.odp, 'Top/Health/Youth') or contains(../@chp.odp , 'Top/Health/Healthy_Lifestyles')
or contains(../@chp.odp , 'Top/Health/Conditions_and_Diseases') or contains(../@chp.odp , 'Top/Health/Travel') or contains(../@chp.odp , 'Top/Health/Health_Care') or contains(../@chp.odp , 'Top/Health/Children')
or contains(../@chp.odp , 'Top/Health/Mental_Health') ">
<xsl:if test = "not(contains(translate(title,'sealo','SEALO'),'SEE ALSO')) and not(contains(translate(title,'Voir aussi','VOIR AUSSI'),'VOIR AUSSI'))">
<h4><a href="/TEST/PageFrwd.jsp?r={chp.rank}&p={../@chp.odp}&ID={link}" class="itemtitle" target="_blank"><xsl:value-of select="title" /></a> </h4>
</xsl:if>
<xsl:if test = "contains(translate(title,'sealo','SEALO'),'SEE ALSO') or (contains(translate(title,'voiraus','VOIRAUS'),'VOIR AUSSI'))">
<h4><a href="{link}" class="itemtitle" target="_blank"><xsl:value-of select="title" /> </a> </h4>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<h4><a href="{link}" class="itemtitle" target="_blank"><xsl:value-of select="title" /> </a> </h4>
</xsl:otherwise>
</xsl:choose>
<span class="itemdesc">
<xsl:value-of select="description" />
<br />
<xsl:apply-templates select="chp.image" />
<xsl:if test="$showpublisher= 'true'">
<span style="font-style: italic;"> Source: <xsl:value-of select="chp.publisher" /></span>
</xsl:if>
</span>
</xsl:template>
<xsl:template match="chp.image" >
<img><xsl:attribute name="src">/TEST/images/<xsl:value-of select="."/></xsl:attribute>
</img>
</xsl:template>
<!-- dh 2004 01 28 should not need this anymore
<xsl:template name="showfocusdescription_e">
<xsl:if test="(@chp.odp = $focusaboriginal)">
<p style="color: #000088;">The Canada Health Portal (CHP) contains information relevant to the health and wellness of Aboriginals Peoples. Here you will find direct and easy access to health care information to help Aboriginals stay healthy and improve their quality of life.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focuschildren)">
<p style="color: #000088;">The Canada Health Portal (CHP) contains information relevant to the health and wellness of children. Here you will find direct and easy access to health care information to help children stay healthy and improve their quality of life.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focusmen)">
<p style="color: #000088;">The Canada Health Portal (CHP) contains information relevant to the health and wellness of men. Here you will find direct and easy access to health care information to help men stay healthy and improve their quality of life.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focusnoncanadians)">
<p style="color: #000088;">The Canada Health Portal (CHP) contains information relevant to the health and wellness of non-Canadians. Here you will find direct and easy access to health care information to help non-Canadians stay healthy and improve their quality of life.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focusseniors)">
<p style="color: #000088;">The Canada Health Portal (CHP) contains information relevant to the health and wellness of seniors. Here you will find direct and easy access to health care information to help seniors stay healthy and improve their quality of life.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focusveterans)">
<p style="color: #000088;">The Canada Health Portal (CHP) contains information relevant to the health and wellness of veterans. Here you will find direct and easy access to health care information to help veterans stay healthy and improve their quality of life.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focuswomen)">
<p style="color: #000088;">The Canada Health Portal (CHP) contains information relevant to the health and wellness of women. Here you will find direct and easy access to health care information to help women stay healthy and improve their quality of life.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focusyouth)">
<p style="color: #000088;">The Canada Health Portal (CHP) contains information relevant to the health and wellness of youth. Here you will find direct and easy access to health care information to help today's youth stay healthy and improve their quality of life.</p>
</xsl:if>
</xsl:template>
<xsl:template name="showfocusdescription_f">
<xsl:if test="(@chp.odp = $focusaboriginal)">
<p style="color: #000088;">Le Portail canadien sur la santé contient de l'information relative à la santé et au bien-être des peuples autochtones. Voici un accès direct et facile à de l'information sur les soins de santé visant à aider les Autochtones à demeurer en santé et à améliorer leur qualité de vie.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focuschildren)">
<p style="color: #000088;">Le Portail canadien sur la santé contient de l'information relative à la santé et au bien-être des enfants. Voici un accès direct et facile à de l'information sur les soins de santé visant à aider les enfants à demeurer en santé et à améliorer leur qualité de vie.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focusmen)">
<p style="color: #000088;">Le Portail canadien sur la santé contient de l'information relative à la santé et au bien-être des hommes. Voici un accès direct et facile à de l'information sur les soins de santé visant à aider les hommes à demeurer en santé et à améliorer leur qualité de vie.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focusnoncanadians)">
<p style="color: #000088;">Le Portail canadien sur la santé contient de l'information relative à la santé et au bien-être des non-Canadiens. Il donne rapidement et facilement accès à des renseignements sur les soins de santé en vue d’aider les non-Canadiens à demeurer en bonne santé et à améliorer leur qualité de vie.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focusseniors)">
<p style="color: #000088;">Le Portail canadien sur la santé contient de l'information relative à la santé et au bien-être des aînés. Voici un accès direct et facile à de l'information sur les soins de santé visant à aider les aînés à demeurer en santé et à améliorer leur qualité de vie.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focusveterans)">
<p style="color: #000088;">Le Portail canadien sur la santé contient de l'information relative à la santé et au bien-être des anciens combattants. Voici un accès direct et facile à de l'information sur les soins de santé visant à aider les anciens combattants à demeurer en santé et à améliorer leur qualité de vie.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focuswomen)">
<p style="color: #000088;">Le Portail canadien sur la santé contient de l'information relative à la santé et au bien-être des femmes. Voici un accès direct et facile à de l'information sur les soins de santé visant à aider les femmes à demeurer en santé et à améliorer leur qualité de vie.</p>
</xsl:if>
<xsl:if test="(@chp.odp = $focusyouth)">
<p style="color: #000088;">Le Portail canadien sur la santé contient de l'information relative à la santé et au bien-être de la jeunesse. Voici un accès direct et facile à de l'information sur les soins de santé visant à aider les jeunes d'aujourd'hui à demeurer en santé et à améliorer leur qualité de vie.</p>
</xsl:if>
</xsl:template>
-->
</xsl:stylesheet>
Reivax962
Messages postés
3672
Date d'inscription
jeudi 16 juin 2005
Statut
Membre
Dernière intervention
11 février 2021
1 011
>
adas
Messages postés
7
Date d'inscription
mardi 13 février 2007
Statut
Membre
Dernière intervention
22 février 2007
21 févr. 2007 à 14:21
21 févr. 2007 à 14:21
Ben pas vraiment, en fait, ça c'est le XSL. Moi je veux le XML sur lequel le XSL doit agir !
Si c'est un XML généré sur lequel tu n'as pas forcément la main, quand il s'affiche dans ton navigateur, fais "afficher le code", et colle-le ici...
Si c'est un XML généré sur lequel tu n'as pas forcément la main, quand il s'affiche dans ton navigateur, fais "afficher le code", et colle-le ici...
adas
Messages postés
7
Date d'inscription
mardi 13 février 2007
Statut
Membre
Dernière intervention
22 février 2007
21 févr. 2007 à 15:50
21 févr. 2007 à 15:50
J'ai trouvé 3 fichiers xml. Un qui s'appelle web.xml, un urlrewrite.xml et un HttpRedirectFilter.xml
Voici le web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://www.oracle.com/webfolder/technetwork/jsc/j2ee/dtds/web-app_2_2.dtd"> -->
<!DOCTYPE web-app SYSTEM "web.dtd">
<web-app>
<display-name>TEST Portal</display-name>
<description>Test of WAR File</description>
<servlet>
<servlet-name>
CHP
</servlet-name>
<servlet-class>
org.apache.turbine.Turbine
</servlet-class>
<init-param>
<param-name>properties</param-name>
<param-value>
WEB-INF/conf/TurbineResources.properties
</param-value>
</init-param>
<init-param>
<param-name>classname</param-name>
<param-value>
org.apache.jetspeed.services.resources.VariableResourcesService
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>TEST</servlet-name>
<url-pattern>/test_e/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>TEST</servlet-name>
<url-pattern>/test_f/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>TEST</servlet-name>
<url-pattern>/TEST/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>TEST</servlet-name>
<url-pattern>/redirect/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>TEST</servlet-name>
<url-pattern>/TEST</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>TEST</servlet-name>
<url-pattern>/test</url-pattern>
</servlet-mapping>
<!-- ================== HttpRedirect Filter ============== -->
<!-- from zlatkovic.com used to handle redirection of CHP's multiple domains. -->
<filter>
<filter-name>HttpRedirectFilter</filter-name>
<filter-class>com.zlatkovic.HttpRedirectFilter</filter-class>
<init-param>
<param-name>configFile</param-name>
<param-value>/WEB-INF/HttpRedirectFilter.xml</param-value>
</init-param>
</filter>
<!-- ==================== URLRewrite Configuration ====================== -->
<!-- from www.tuckey.org Used to clean the incoming URL requests for the -->
<!-- test. Rules are defined in the urlrewrite.xml file. -->
<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>HttpRedirectFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<env-entry>
<env-entry-name>dbprodname</env-entry-name>
<env-entry-value>prod</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
<env-entry>
<env-entry-name>dbhost</env-entry-name>
<env-entry-value>localhost</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
<env-entry>
<env-entry-name>dbport</env-entry-name>
<env-entry-value></env-entry-value>
<env-entry-type>java.lang.Integer</env-entry-type>
</env-entry>
<env-entry>
<env-entry-name>dbuser</env-entry-name>
<env-entry-value>test</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
<env-entry>
<env-entry-name>dbpassword</env-entry-name>
<env-entry-value>test</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
<env-entry>
<env-entry-name>log4j.configuration</env-entry-name>
<env-entry-value>./log4j.properties</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
</web-app>
???
J'essaie de remplacer le programmeur mais... Merci beaucoup!
Voici le web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://www.oracle.com/webfolder/technetwork/jsc/j2ee/dtds/web-app_2_2.dtd"> -->
<!DOCTYPE web-app SYSTEM "web.dtd">
<web-app>
<display-name>TEST Portal</display-name>
<description>Test of WAR File</description>
<servlet>
<servlet-name>
CHP
</servlet-name>
<servlet-class>
org.apache.turbine.Turbine
</servlet-class>
<init-param>
<param-name>properties</param-name>
<param-value>
WEB-INF/conf/TurbineResources.properties
</param-value>
</init-param>
<init-param>
<param-name>classname</param-name>
<param-value>
org.apache.jetspeed.services.resources.VariableResourcesService
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>TEST</servlet-name>
<url-pattern>/test_e/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>TEST</servlet-name>
<url-pattern>/test_f/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>TEST</servlet-name>
<url-pattern>/TEST/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>TEST</servlet-name>
<url-pattern>/redirect/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>TEST</servlet-name>
<url-pattern>/TEST</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>TEST</servlet-name>
<url-pattern>/test</url-pattern>
</servlet-mapping>
<!-- ================== HttpRedirect Filter ============== -->
<!-- from zlatkovic.com used to handle redirection of CHP's multiple domains. -->
<filter>
<filter-name>HttpRedirectFilter</filter-name>
<filter-class>com.zlatkovic.HttpRedirectFilter</filter-class>
<init-param>
<param-name>configFile</param-name>
<param-value>/WEB-INF/HttpRedirectFilter.xml</param-value>
</init-param>
</filter>
<!-- ==================== URLRewrite Configuration ====================== -->
<!-- from www.tuckey.org Used to clean the incoming URL requests for the -->
<!-- test. Rules are defined in the urlrewrite.xml file. -->
<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>HttpRedirectFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<env-entry>
<env-entry-name>dbprodname</env-entry-name>
<env-entry-value>prod</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
<env-entry>
<env-entry-name>dbhost</env-entry-name>
<env-entry-value>localhost</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
<env-entry>
<env-entry-name>dbport</env-entry-name>
<env-entry-value></env-entry-value>
<env-entry-type>java.lang.Integer</env-entry-type>
</env-entry>
<env-entry>
<env-entry-name>dbuser</env-entry-name>
<env-entry-value>test</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
<env-entry>
<env-entry-name>dbpassword</env-entry-name>
<env-entry-value>test</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
<env-entry>
<env-entry-name>log4j.configuration</env-entry-name>
<env-entry-value>./log4j.properties</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
</web-app>
???
J'essaie de remplacer le programmeur mais... Merci beaucoup!
Reivax962
Messages postés
3672
Date d'inscription
jeudi 16 juin 2005
Statut
Membre
Dernière intervention
11 février 2021
1 011
21 févr. 2007 à 15:58
21 févr. 2007 à 15:58
Mmmmh...
En fait, quand tu affiches tes données, dans ton navigateur...
Essaie de faire "Afficher la source", et copie-colle-moi tout ça :)
Parce que je ne pense pas que les fichiers que tu m'aies donnés soient les bons, d'ailleurs, ils ne pointent pas vers ton fichier XSL.
En fait, quand tu affiches tes données, dans ton navigateur...
Essaie de faire "Afficher la source", et copie-colle-moi tout ça :)
Parce que je ne pense pas que les fichiers que tu m'aies donnés soient les bons, d'ailleurs, ils ne pointent pas vers ton fichier XSL.
adas
Messages postés
7
Date d'inscription
mardi 13 février 2007
Statut
Membre
Dernière intervention
22 février 2007
22 févr. 2007 à 15:02
22 févr. 2007 à 15:02
Dans un document, appellé languageservice.java, j'ai trouvé le script suivant:
String imageName=oU.getValue(itemObjectInterface,"test:image");
// imageName="logo-youthpath_e.jpg";
// Iether Null or value is returned from database
if (imageName!=null){
Element itemImage=categoryDoc.createElement("chp.image");
itemImage.appendChild(categoryDoc.createTextNode(imageName));
item.appendChild(itemImage);
Est-ce que vous pensez que c'est là que je devrais ajouter le "alt"?
Qu'en pensez-vous!
String imageName=oU.getValue(itemObjectInterface,"test:image");
// imageName="logo-youthpath_e.jpg";
// Iether Null or value is returned from database
if (imageName!=null){
Element itemImage=categoryDoc.createElement("chp.image");
itemImage.appendChild(categoryDoc.createTextNode(imageName));
item.appendChild(itemImage);
Est-ce que vous pensez que c'est là que je devrais ajouter le "alt"?
Qu'en pensez-vous!