Re: [xsl] text() and not()

Subject: Re: [xsl] text() and not()
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 8 Jan 2002 13:17:23 GMT
> If I dont use this a load of info gets output that isnt necessary in this
> instance (but it useful to someone somewhere :)

No. only if you apply templates to elements containing that text,
it is far more common to select or not select elements rather than
selecting all elements but then just not copying the text nodes.


> >//text()[not(parent::title)]
> 
> This is close :) however it fails to match the trailing close bracket ')'
> for some reason.

that matches any text node  whose parent is not title.

There are three text nodes in your example.
the first has parent title
the second has parent xref
the third (which is just white space)
All the text nodes in your example have parent title, so it 
does not match any of them.

<title>
  Renew LP Piston Seal (Fig 5.5.1
  <xref xrefid="F5.5.1" xidtype="FIGURE">) </xref>
</title>


What do you want to do that isn't done by

<xsl:template match="title">
<p class="title">
  <xsl:apply-templates/>
</p>
</xsl:template>

<xsl:template match="xref">
 [whatever you want xref to do]
</xsl:template>

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread