Hallo,
ich habe ein Problem mit
und zwar möchte ich dies auf die Kindknoten des Knotens "table_structure" beschränken.
Momentan nimmt er scheinbar alle Kindknoten des Wurzelknotens. Ich habe es schon folgendermassen probiert:
<xsl:if test="name() = 'field' and ancestor[name() = 'table_structure']">
d.h. ich möche nur alle "field" Knoten ansprechen, die auch "table_structure" als Vaterknoten haben. Nur funktioniert diese Abfrage scheinbar nicht, es muss wohl ein Fehler in dem Ausdruck vorliegen. Kann mir jemand bitte dabei behilflich sein?
Vielen Dank für Antwort im voraus!
ich habe ein Problem mit
Code:
<wurzel> <table_structure> <field>...</field> ... <field>...</field> </table_structure> <weiter> <field>...</field> ... <field>...</field> </weiter> </wurzel>
Code:
<xsl:template match="table_structure"> <xsl:for-each select="child::*"> <xsl:if test="name()='field' "> <xsl:value-of select="name()"/> </xsl:if> </xsl:for-each> </xsl:template>
Momentan nimmt er scheinbar alle Kindknoten des Wurzelknotens. Ich habe es schon folgendermassen probiert:
<xsl:if test="name() = 'field' and ancestor[name() = 'table_structure']">
d.h. ich möche nur alle "field" Knoten ansprechen, die auch "table_structure" als Vaterknoten haben. Nur funktioniert diese Abfrage scheinbar nicht, es muss wohl ein Fehler in dem Ausdruck vorliegen. Kann mir jemand bitte dabei behilflich sein?
Vielen Dank für Antwort im voraus!
Comment