This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Returning a Tree


Ahh... I knew about the result tree fragments, and I'm using Saxon, which
automatically converts them to node sets. What threw me was even with the
<copy-of> (which I had expected to return a RTF), count($B) was returning 1.
Don't know why it didn't dawn on me to do count($B/B) or count($B/node())...

Thanks!!

Darren

-----Original Message-----
Date: Thu, 6 Sep 2001 10:51:26 +0200 (CEST)
From: "Swen Thuemmler" <Swen.Thuemmler@paderlinx.de>
Subject: Re: [xsl] RE: Returning A Tree

[snip]
But newer processors seemt to do the conversion themselves (in anticipation
of
the changes in XSL-1.1 (or 2.0), so with Saxon 6.4 I can also say:

  <xsl:for-each select="$B/B">
     <xsl:value-of select="."/>
     <xsl:if test="not(position()=last())">
        <xsl:text>,</xsl:text>
     </xsl:if>
  </xsl:for-each>

--- and ---
Date: Thu, 6 Sep 2001 09:59:19 +0100
From: Jeni Tennison <mail@jenitennison.com>
Subject: Re: [xsl] RE: Returning A Tree

[snip]
The reason, then, that you aren't getting the output that you expect
is that you're counting and getting the value of the root nodes of
these node trees, rather than the children of the root node. If you
try:

  <xsl:for-each select="$A/node()">...</xsl:for-each>
  <xsl:for-each select="$B/node()">...</xsl:for-each>
  <xsl:value-of select="count($B/node())" />

then you will get the results that you are after.
_______________________________________________
Darren Hayduk | Network Management
Nauticus Networks, Inc.
200 Crossing Blvd, Framingham, MA 01702
508-270-0500 x299

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]