Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 3116 invoked from network); 30 Jun 2008 12:03:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Jun 2008 12:03:30 -0000 Received: (qmail 71210 invoked by uid 500); 30 Jun 2008 12:03:29 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 71135 invoked by uid 500); 30 Jun 2008 12:03:29 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: users@cocoon.apache.org List-Id: Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 71124 invoked by uid 99); 30 Jun 2008 12:03:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jun 2008 05:03:29 -0700 X-ASF-Spam-Status: No, hits=-1.0 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ap-cocoon-users@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jun 2008 12:02:35 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KDI5v-0002ez-MX for users@cocoon.apache.org; Mon, 30 Jun 2008 12:02:55 +0000 Received: from cust.static.84-253-63-109.cybernet.ch ([84.253.63.109]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 30 Jun 2008 12:02:55 +0000 Received: from andreas by cust.static.84-253-63-109.cybernet.ch with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 30 Jun 2008 12:02:55 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: users@cocoon.apache.org From: Andreas Hartmann Subject: Re: Tags in the value of an XSLT variable? Date: Mon, 30 Jun 2008 14:02:46 +0200 Lines: 98 Message-ID: References: <486519BE.8020107@comsine.co.uk> <2415.207.168.47.25.1214585293.squirrel@www.eccnet.com> <4868AC75.5CE9.00D4.0@csir.co.za> <4868C04B.8010507@comsine.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: cust.static.84-253-63-109.cybernet.ch User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) In-Reply-To: <4868C04B.8010507@comsine.co.uk> Sender: news X-Virus-Checked: Checked by ClamAV on apache.org Andrew Chamberlain schrieb: > Hi Betty/Derek, > > Thanks for getting back. > > Yes, that's certainly helped. I'm now confident that my variable also > contains the tags in addition to the values. It was by changing the "." > for "@* | node()" that did it. > > So my xslt looks like this: > > > > > > However, I now believe this variable is still a Node-Tree, and not a > String. I need it to be the latter so I can pass the XML excerpt to the > Java method I mentioned earlier (using xalan to do so). > > Is there a way of casting/translating a node tree into a String? That would be XML serializing. AFAIK XSLT is not capable of this (I don't know about XSLT 2.0, though). Why do you have to convert the fragment to a string? Wouldn't it be more straightforward to pass the fragment to the Java code, so that it doesn't have to be parsed again? -- Andreas > > Best regards, > > Andy > > ------------------------------------------------------------------------ > > Derek Hohls wrote: >> And that is not a "trick", but standard XSLT; see: >> http://www.dpawson.co.uk/xsl/sect2/N1930.html#d3389e91 >> as select="." only selects the value (string) inside the tag/s. >> >> >>>>> On 2008/06/27 at 06:48, in message <2415.207.168.47.25.1214585293.squirrel@www.eccnet.com>, "Betty Harvey" wrote: >>>>> >> Try this for your xsl:copy: >> >> >> >> >> >>> Hi All, >>> >>> It's quite possible that this is more XSLT-related than Cocoon itself, >>> but wasn't sure where else to post. >>> >>> I'm using an XSL transformer and need to capture a tree fragment in the >>> value of variable ... including the tags themselves. The reason for >>> this is because I need to pass the XML excerpt (as a string) to a Java >>> class which is specifically written to parse it. >>> >>> I'm trying the following, but this only seems to include the values, and >>> not the tags: >>> >>> >>> >>> >>> >>> Can anyone help? Is there a trick for this? >>> >>> Many thanks, >>> >>> Andy >>> >> >> >> >> -- >> This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. >> The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. >> >> This message has been scanned for viruses and dangerous content by MailScanner, >> and is believed to be clean. MailScanner thanks Transtec Computers for their support. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org >> For additional commands, e-mail: users-help@cocoon.apache.org >> >> . >> >> -- Andreas Hartmann, CTO BeCompany GmbH http://www.becompany.ch Tel.: +41 (0) 43 818 57 01 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org