Subject: Re: [xsl] (simple?) xpath question From: Evan Lenz <evan@xxxxxxxxxxxx> Date: Fri, 29 Aug 2008 13:07:15 -0700 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- By default, copy all nodes unchanged --> <xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template>
<!-- But skip <b> elements and only process their contents --> <xsl:template match="b"> <xsl:apply-templates/> </xsl:template>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- By default, copy <a> and <c> elements --> <xsl:template match="a | c"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template>
<!-- But skip by every other element --> <xsl:template match="*"> <xsl:apply-templates/> </xsl:template>
All *help*!
What is the best way to query xml with xpath to get a disjoint nodelist? Specifically i want to include just the root node alongwith a descendent node. XML:
<a>
<b>
<c>
</c>
</b>
</a>
XPATH:
//c
DESIRED RESULT NODELIST:
i.e. not this:
<c>
</c>
but rather this:
<a>
<c>
</c>
</a>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] (simple?) xpath question, mark bordelon | Thread | [xsl] Commented contents not consi, V.Ramkumar |
Re: [xsl] (simple?) xpath question, mark bordelon | Date | Re: [xsl] (simple?) xpath question, mozer |
Month |