Subject: Re: [xsl] count string-length without white-space and breaking if white-spa ce exists after 126 characters From: "Vasu Chakkera" <vasucv@xxxxxxxxxxx> Date: Thu, 20 Jun 2002 15:49:43 +0000 |
Hans , The following is your solution I have considered the following XML..
Will this serve your purpose??? Vasu
From: "Braumüller, Hans" <h.braumueller@xxxxxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: "'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'" <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: [xsl] count string-length without white-space and breaking if white-spa ce exists after 126 characters
Date: Thu, 20 Jun 2002 17:04:35 +0200
Hi,
can please anyone indicate me,
First,
why i get the tag <br> in the output
if i have in the xml source
<memotext></memotext>
and my xsl-snippet is:
<xsl:value-of select="substring(../memotext, 1, 126)" /> <xsl:if test="string-length((../memotext) > 126)"> <br /></xsl:if> <xsl:value-of select="substring(../memotext, 127, string-length(../memotext))"/>
What i am trying to do is counting the characters of the text-node of memotext
and if the string-length is greater than 126 i want a <br /> only then.
Now i get always a <br />
Is the string-length counting from the position i call <xsl:if test="string-length((../memotext) > 126)"> <br /></xsl:if> ?
My XML- snippet: etc .. <row> etc.. <memotext></memotext>
<DARKONTRAKT> etc .. <!-- from this level i match to test the value of memotext -->
</DARKONTRAKT> </row> etc ..
Second, how can i omit (not counting) the white-space characters by the string-length calculation?
Third, how can i put the <br /> (linebreak) after 126 characters in the output, when a white-space character occurs ?
Thanks,
Hans Braumüller
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] count string-length witho, David Carlisle | Thread | [xsl] Re: : Re: AW: Article: An XSL, Dimitre Novatchev |
Re: [xsl] count string-length witho, David Carlisle | Date | Re: [xsl] Long time no axes/documen, Jeni Tennison |
Month |