xsl-list
[Top] [All Lists]

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

2006-11-23 10:18:17
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 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>