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

Re: preserving html tags

Subject: Re: preserving html tags
From: Karl <call14@xxxxxxxxx>
Date: Thu, 2 Nov 2006 12:19:34 +0000 (GMT)
xsl copy of html tags
Thanks for the explanation mike. Yes, undertood your point "tree of
element and text nodes".

I did changed my code and i'm pretty sure the sub-string strips the
subtree elements. 

Basically i tried with copy-of as below in the trimPara template

	<xsl:template name="trimPara">
		<xsl:param name="stringLenRequired"/>
		<xsl:param name="stringInput"/>
<xsl:copy-of select="$stringInput"/> <!-- this copy-of test code
works diplayinng subtree elements like <b>bold</b> etc however the
below code with sub-string fails -->

		<xsl:copy-of
select="substring($stringInput,1,number($stringLenRequired))"/>
		<xsl:copy-of
select="substring-before(concat(substring($stringInput,number($stringLenRequired)+1,number($stringLenRequired)
+20),' ' ),' ')"/> <!-- prev i used value-of -->
		<xsl:if test="string-length($stringInput) >
number($stringLenRequired)">...</xsl:if>
	</xsl:template>

I don't know of any other mechanism equivalent to sub-string. I have
2 q's now based on your reply

1.  On "you could approximate by doing this only one level deep,
which is a fair bit easier" - yes, mine goes only one level deeper.
Pls suggest how could i achieve this

2. On "It needs a recursive walk of the subtree" - My q is even if i
use recursive, how can i avoid using sub-string? pls can you give me
some clue or code sample.

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-2007 All Rights Reserved.