xslt - value of select ignore one type of child -
i've below xml
<p> <b>chapter 3: industrial drawings</b> <fn> <fnn>11</fnn> <fnt> <p>fnt 1</p> </fnt> </fn> <b>and designs</b> </p>
and i'm using below line, i'm getting data in p
<xsl:template match ="p"> <xsl:value-of select="descendant-or-self::*/text() except descendant::fn"/> </xsl:template>
here i'm trying content of p
, ignore fn
node(). output
chapter 3: industrial drawings11fnt 1and designs
but expected
chapter 3: industrial drawings , designs
here i'm using descendant-or-self::*/text()
because there might many cases below.
p/b/text() p/b/c/text() p/i/c/text() etc...
i want ignore fn
, print text(). please let me know how can this.
the except
operator set difference, x except y
gives nodes in set x , not in set y. in case "x" set of text nodes , "y" set of element nodes, won't exclude anything. if wanted descendant text nodes except inside fn
say
<xsl:value-of select=".//text()[not(ancestor::fn)]"/>
Comments
Post a Comment