 |
Die letzten 5 Postings in diesem Thema » Alle anzeigen
von lizzy |
und in den entsprechenden Haupt-XSL files:
<xsl:call-template name="Ueberschrift">
<xsl:with-param name="title">der echte Wert</xsl:with-param>
</xsl:call-template> |
von lizzy |
Hallo nochmal:
hier die Lösung, falls es jemanden interessiert:
<xsl:template name="Ueberschrift">
<xsl:param name="title" />
<table height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="center" nowrap="nowrap">
<font class="lab">
<xsl:value-of select="$title" />
</font>
</td>
</tr>
</table>
</xsl:template>
lg
Rondra |
von lizzy |
Hallo!
Ich habe wiederholte Elemente in meinen u.g. 3 XSL-Dateien (SEARCH.XSL, HITS.XSL und FILE.XSL). Die möchte ich mit einer template.xsl zusammenfassen, damit ich den Code besser pflegen kann.
Habe zum Verständnis folgende Codes (vereinfacht):
VORHER: ----------------------
SUCHSEITE(search.xsl):
<table height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="center" nowrap="nowrap">
<font class="lab">SUCHE</font>
</td>
</tr>
</table>
TREFFERLISTE (hits.xsl):
<table height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="center" nowrap="nowrap">
<font class="lab">TREFFER</font>
</td>
</tr>
</table>
FILESEITE (file.xsl):
<table height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="center" nowrap="nowrap">
<font class="lab">FILE</font>
</td>
</tr>
</table>
Wie ihr sehen könnt ist das Table identisch , nur die Überschrift im font-element ist es nicht ("SUCHE", "TREFFER", "FILE") . Jetzt möchte ich das table in das template.xsl reinpacken, damit ich es nur dort pflegen muss und nicht in jedem der 3 codes extra:
NACHHER: ---------------------------------
TEMPLATE.XSL:
<xsl:template name="Ueberschrift">
<table height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="center" nowrap="nowrap">
<font class="lab">XXXXXX</font>
</td>
</tr>
</table>
</xsl:template>
SUCHSEITE(search.xsl):
<xsl:call-template name="Ueberschrift"/>
TREFFERLISTE (hits.xsl):
<xsl:call-template name="Ueberschrift"/>
FILESEITE (file.xsl):
<xsl:call-template name="Ueberschrift"/>
-----------------------
Mein Probelm ist: wie kriege ich die richtige Überschrift in das richtige Stylesheet...? Das habe ich oben mit XXXX gekennzeichnet. Wie kann man das bloss realisieren?
Danke für jeden Tipp!!
lg
Rondra |
|
|
|