Subject: Re: [xsl] testing relationships between nodes From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx> Date: Thu, 14 Sep 2006 21:59:26 +0530 |
<?xml version="1.0" encoding="UTF-8"?> <x> <y> <z/> </y> </x>
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/"> <xsl:apply-templates select="x" /> </xsl:template>
<xsl:template match="x"> <xsl:if test=".//z"> x is ancestor of z </xsl:if> </xsl:template>
If this is a general XPath question, then I think above could be the appropriate answer.
If you need to do something specific, please let us know. There could be other explanations.
Hello,
alas, I cannot see any way to check whether a given node is an ancestor of a given other node in XPath. How do I do this?
Best wishes, Wolfgang
-- Regards, Mukul Gandhi
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] testing relationships bet, Michael Kay | Thread | RE: [xsl] testing relationships bet, Michael Kay |
Re: [xsl] testing relationships bet, Wolfgang Jeltsch | Date | RE: [xsl] testing relationships bet, Michael Kay |
Month |