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

using copy-of and substring-ing retaining child elemen

Subject: using copy-of and substring-ing retaining child elements
From: Karl <call14@xxxxxxxxx>
Date: Thu, 23 Nov 2006 17:17:56 +0000 (GMT)
javascript child copy
Further refering to question on "combination of copy-of and
apply-templates", i have similar issue, but difference being i need
to substring the text retaining sub elements.

My xml has

<root>
 <p>some text <b>achild element, but valid html elements</b> and more
like this like <i>italic </i> text text .... BIG CONTENT </p>
 <p/> <!-- may similar paras -->
</root>

Now, in my html, i need to display the content, but restricting to
say 100 chars, but retaining the valid child elements like <b/>, <i/>
for display purpose.

I use copy-of, but I loose child elements while doing substring
[understandable as it was string function and hence converting to
string i believe]. 

I have 2 questions now:

1) Is there a way by using xslt, I can display <p/> content
restricting to certain chars, but retaining child elements.

2) Do i need to use any javascript function to acheive this? [we have
issues using javascript within our development environment, but if
needed we can by pass it]

Pls let me know possible solutions. Thanks in advace.
karl


Send instant messages to your online friends http://uk.messenger.yahoo.com 

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.