Hallo,
Mein Konstrukt sollte die Anzal der Kindelemente KNOTEN2 unterhalb von KNOTEN1 zaehlen.
Genau das sollte es sein. Aber es haut nicht hin.
Dann stimmt Dein Kontext nicht.
Zu diesem XML-Dokument
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="test.xsl" type="text/xsl"?>
<wurzel>
<KNOTEN1>
<KNOTEN2>a</KNOTEN2>
<KNOTEN2>b</KNOTEN2>
<KNOTEN2>c</KNOTEN2>
<KNOTEN2>d</KNOTEN2>
<KNOTEN2>e</KNOTEN2>
</KNOTEN1>
</wurzel>
liefert dieses Stylesheet (test.xsl)
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="ISO-8859-1"/>
<xsl:template match="wurzel">
<html>
<head>
<title>Test</title>
</head>
<body>
Anzahl KNOTEN1/KNOTEN2: <xsl:value-of select="count(KNOTEN1/KNOTEN2)"/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
die Ausgabe
Anzahl KNOTEN1/KNOTEN2: 5
MfG, Thomas