[Home] [By Thread] [By Date] [Recent Entries]
On 07.07.2016 07:22, Kenneth Reid Beesley krbeesley@xxxxxxxxx wrote:
If I start with an input XML document that contains mixed text with <word> elements like this: Ibve tried matching the text() in a separate template, but I canbt seem to reference the attribute values of the parent node (i.e., <word>) of the text() and the parent nodebs attributes. E.g, the following doesnbt work for me, failing somehow in the select=b../@correctionb reference. You can use <xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template> <xsl:template match="word[@correction]/text()"> <xsl:value-of select="../@correction"/> </xsl:template> <xsl:template match="word/@correction"> <xsl:attribute name="origerror" select=".."/> </xsl:template>
|

Cart



