Code:<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:variable name="lf" select="'
'"/> <xsl:template match="/"> <xsl:text>von der root</xsl:text> <xsl:value-of select="$lf"/> <xsl:if test="root/bla/rel/@a='test1' and root/bla/rel/@b='test2'">test1 und test2</xsl:if> <xsl:value-of select="$lf"/> <xsl:if test="root/bla/rel/@a='test1' and root/bla/rel/@b='test2'">test1 und test2</xsl:if> <xsl:value-of select="$lf"/> <xsl:if test="root/bla/rel/@a='test1' and root/bla/rel/@b='test2'">test1 und test2</xsl:if> <xsl:value-of select="$lf"/> <xsl:apply-templates select="root/bla"/> </xsl:template> <xsl:template match="bla"> <xsl:text>in Tag blah</xsl:text> <xsl:value-of select="$lf"/> <xsl:if test="rel/@a='test1' and rel/@b='test2'">test1 und test2</xsl:if> <xsl:value-of select="$lf"/> <xsl:if test="rel/@a='test3' and rel/@b='test4'">test3 und test4</xsl:if> <xsl:value-of select="$lf"/> <xsl:if test="rel/@a='test5' and rel/@b='test6'">test5 und test6</xsl:if> <xsl:value-of select="$lf"/> <xsl:if test="rel[@a='test1' and @b='test2']">test1 und test2</xsl:if> <xsl:value-of select="$lf"/> <xsl:if test="rel[@a='test3' and @b='test4']">test3 und test4</xsl:if> <xsl:value-of select="$lf"/> <xsl:if test="rel[@a='test5' and @b='test6']">test5 und test6</xsl:if> <xsl:value-of select="$lf"/> <xsl:text>im Tag rel"</xsl:text> <xsl:apply-templates select="rel"/> </xsl:template> <xsl:template match="rel"> <xsl:value-of select="$lf"/> <xsl:if test="@a='test1' and @b='test2'">test1 und test2</xsl:if> <xsl:if test="@a='test3' and @b='test4'">test3 und test4</xsl:if> <xsl:if test="@a='test5' and @b='test6'">test5 und test6</xsl:if> </xsl:template> </xsl:stylesheet>
man sollte wissen wo man sich im Baum befindetCode:von der root test1 und test2 test1 und test2 test1 und test2 in Tag blah test1 und test2 test3 und test4 test5 und test6 test1 und test2 test3 und test4 test5 und test6 im Tag rel" test1 und test2 test3 und test4 test5 und test6
Helmut Hagemann


LinkBack URL
About LinkBacks
Zitieren