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

Re: Need help with apply-templates to set variables

Subject: Re: Need help with apply-templates to set variables
From: Trevor Nash <tcn@xxxxxxxxxxxxx>
Date: Sun, 03 Feb 2002 20:13:18 +0000
Re:  Need help with apply-templates to set variables
Brad,

Think trees not text.

><xsl:value-of select="task:addPage($task, @ident, $body)" />
></xsl:template>
>
>When $body is received (as a String) by my addPage routine, it 
>contains only text with all markup removed. For example, for 
>this input
>
If the third argument to addPage is declared as a String, and you pass
it a result tree fragment, then the XSLT processor will do an implicit
conversion using the XPath string() function.  This returns just the
text nodes, i.e. no markup.

You probably need to change the signature (and internal logic) of
addPage to handle DOM nodes instead of strings - without knowing what
the structure of the overall application is, it is hard to give
detailed advice.

>It seems that markup is deleted only when the results are saved 
>in a variable. If I add a <xsl:apply-templates select="*"/> 
>outside of the variable assignment in the above, the output 
>contains markup as expected.
>
I'm not sure what you are seeing here - but I think you are being
misled.
Try <xsl:copy-of select="$body" /> and you will see "markup" in the
output: this should convince you that its nothing to do with the
variable, the information is being lost in the call to Java, for the
reason I gave above.

Regards,
Trevor Nash
--
Traditional training & distance learning,
Consultancy by email

Melvaig Software Engineering Limited
voice:     +44 (0) 1445 771 271 
email:     tcn@xxxxxxxxxxxxx

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


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.