Return-Path: Mailing-List: contact cocoon-users-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-users@xml.apache.org Received: (qmail 77098 invoked from network); 28 Mar 2000 10:24:34 -0000 Received: from stanley.thebunker.net (193.115.128.4) by locus.apache.org with SMTP; 28 Mar 2000 10:24:34 -0000 Received: (qmail 17991 invoked from network); 28 Mar 2000 10:59:59 -0000 Received: from unknown (HELO aldigital.co.uk) (172.16.1.3) by 172.16.254.254 with SMTP; 28 Mar 2000 10:59:59 -0000 Message-ID: <38E0874A.40D3A133@aldigital.co.uk> Date: Tue, 28 Mar 2000 11:19:54 +0100 From: Phil Lanch Organization: A L Digital X-Mailer: Mozilla 4.61 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 To: cocoon-users@xml.apache.org Subject: Re: This page was served in ... References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Mariusz Nowostawski wrote: > > itself. If I have something like: > > > arbitrary text > > and call text() on the context element I am getting "arbitrary text" as > expected. If I have: > > > arbitrary text > > > > text() is still returning expected text. However, if I have: > > > > arbitrary text > > > text() is returning either empty EOL or some spaces + EOL character. I > tried child::text() and even going throuhg all children of tag1 via > for-each but I could not anyhow get exptected "arbitrary text". What > expression I should use (for Cocoon) to return a concatenation of all text > nodes? To me child::text() or just text() should work in the last case as > well - is it an implementation issue or I am missusing text() ? text() is all the text-node children of the current node (i.e. tag1), so- -should work. however, when a node-set is converted to a string, the result is the string value of just the first node in the set, so- -doesn't work when tag1 has more than one text child; actually, it wasn't guaranteed to work in your first example, because the parser can split a bit of text in XML into as many text nodes as it likes (because that may be more efficient for long bits of text). you could use- -since the string value of an element node is the concatenation of all its text-node descendants. -- cheers phil "When Alkan said, 'How are you?' the question had a total nuance: he really wanted to know how you were, although at the same time he was asking the question purely for the sake of social from. Yet he managed simultaneously to acknowledge both of these conflicting messages and still reformulated the question so that it incorporated them and yet was devoid of all assumptions. Furthermore none of the above seemed to be _implied_."