[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

text() and not()

Subject: text() and not()
From: "Andrew Welch" <andrew@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 8 Jan 2002 10:21:16 -0000
 text() and not()
Hi all,

I have a problem with the default template, text() and an element within
another element.

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

I want this to output as:

Renew LP Piston Seal (Fig 5.5.1 xref )

where 'xref' will be replaced by a graphic.

I am overriding the default template using

<xsl:template match=text()/>

because there are several hundred elements that arent for display.  However,
matching <xref> with a separate template and overriding the default template
in this way means 'xref' is moved outside the (fig).  I have been told to
override the default template with a predicate to not include <title> and
use the default template to output the contents of <title>.

I have two points:

1.  //*[not(name()='title')] matches all elements apart from the text in

    //text()[not(name()='title')] matches all text, including that in

What xpath do I need to use to stop all text except that in <title>?

2.  If I use the default template to output the contents of <title>, how do
I obtain the same sort of result as:

<xsl:template match="para0/title">
  <p class="title"><xsl:value-of select="."/></p>

Something like:

<p class="title">
  <xsl:apply-templates select="titleTemplate"/>

(...and change match to name)



(btw, I have been using xpath visualiser, is anyone interested in
implementing a 'reverse visualiser' or similar.  Im sure I found one on the
web long ago that was a bit limited.  A product like that has to be a
winner, right? :)

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

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.