W
webwesen
hello,
an xsl virgin here... please be gentle...
got the following xml (PMD output):
================================
<file name="abc.java">
<violation line="108">
Avoid unnecessary return statements
</violation>
<violation line="179">
Avoid unnecessary return statements
</violation>
</file>
================================
and an xsl (irrelevant lines skipped):
================================
<xsl:template match="file" mode="pmd">
<xsl:value-of select="@name"/>
<xsl:apply-templates select="violation" mode="pmd"/>
</xsl:template>
<xsl:template match="violation" mode="pmd">
<xsl:value-of select="@name"/> <!-- AAA -->
<xsl:value-of select="@line"/>
</xsl:template>
================================
and the line (marked with AAA) is obviously wrong... @name belongs to
<file> and not to <violation>.
how can I reference an attribute of the parent tag from the child?
an xsl virgin here... please be gentle...
got the following xml (PMD output):
================================
<file name="abc.java">
<violation line="108">
Avoid unnecessary return statements
</violation>
<violation line="179">
Avoid unnecessary return statements
</violation>
</file>
================================
and an xsl (irrelevant lines skipped):
================================
<xsl:template match="file" mode="pmd">
<xsl:value-of select="@name"/>
<xsl:apply-templates select="violation" mode="pmd"/>
</xsl:template>
<xsl:template match="violation" mode="pmd">
<xsl:value-of select="@name"/> <!-- AAA -->
<xsl:value-of select="@line"/>
</xsl:template>
================================
and the line (marked with AAA) is obviously wrong... @name belongs to
<file> and not to <violation>.
how can I reference an attribute of the parent tag from the child?