XSLT - Vorkommen eines Attributs zählen

mtk-flo

Erfahrenes Mitglied
Hallo,
ich will ein Attribute zählen wie of es vorkommt.

Ich habe folgende Struktur:
Code:
Kategorie
--- Kapitel
------ Abschnitt
--------- Eintrag (Attribute: Index & Beanstandung)
------------ Frage
------------ Antwort

Ich laufe nun über Kategorie, Kapitel und Abschnitt.
Wenn im Abschnitt ein Beanstandungs-Attribute mit einem Wert gefüllt ist, möchte ich es wissen, dass ich was ausgeben kann.

Wie mach ich das am besten ?

So funktioniert es nicht :/
Code:
<xsl:variable name="foundIt" select="count(Eintrag/@Beanstandung[.][1])"/>
<xsl:if test="$foundIt &gt; 0">
<fo:block>
X
</fo:block>
</xsl:if>

PS: Das hab ich aus dem Internet, weiß aber nicht (und finde auch keine beschreibung) wofür das [.] und das [1] stehen.
Kann mir da auch jemand helfen ?
 
Gelöst:

<xsl:variable name="foundIt" select="count(Eintrag[@Beanstandung = 'X'])"/>
<xsl:if test="$foundIt &gt; 0">
<fo:block>
X
</fo:block>
</xsl:if>
 
Zurück