[xsl] using copy-of and substring-ing retaining child elements

Subject: [xsl] using copy-of and substring-ing retaining child elements
From: Karl <call14@xxxxxxxxx>
Date: Thu, 23 Nov 2006 17:17:56 +0000 (GMT)
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