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

RE: Extract First node

Subject: RE: Extract First node
From: david_n_bertoni@xxxxxxxxxx
Date: Fri, 2 Sep 2005 02:13:50 -0400
first node in xslt
> Hi,
> Couple of things, I am using stylesheet v="2.0" with Saxon-B8.5 instead
> of version="1.0" and Saxon8.4.

OK, that was an important detail that you left out.  This is why including 
complete _minimal_ stylesheet can save lots of confusion and bandwidth.

> I also tried to transform it with Xalan2.7.0 and get the desired output
> as is yours. But I have to use vesrion="2.0" for other stuff in my real
> xslt as this one is just an example. Can anyone tell me if this is a
> known issue with Saxon-B8.5

xsl:value-of works differently in XSLT 2.0 than it does in 1.0:

http://www.w3.org/TR/xslt20/#value-of

One option is to use backwards-compatible behavior:

http://www.w3.org/TR/xslt20/#dt-backwards-compatible-behavior

another is to ensure you only select one node:

<xsl:template match="/a">
  <xsl:value-of select="(b/c[@type='pdf'][1])[1]" />
</xsl:template>

Note that the following might be what you really want -- it's hard to tell 
from your prose description of the problem:

<xsl:template match="/a">
  <xsl:value-of select="(b/c[@type='pdf'])[1]" />
</xsl:template>

Dave

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.