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

Splitting Node Output CORRECTED

Subject: Splitting Node Output CORRECTED
From: "HEATH ALLISON" <HEATH.ALLISON@xxxxxxxxxxxxxxx>
Date: Fri, 24 Jan 2003 10:48:43 -0600
 Splitting Node Output CORRECTED
Sorry. Ignore my last message. It had an erroneous paragraph.

I want to take this form element:
<BlAH>a brown dog jumped over a lazy fox who cares</BLAH>

and put into a table that's aligned like this:

<TR><TD colspan="2">a brown dog jumped over a</TD></TR>
<TR><TD>lazy fox who cares</TD><TD></TD></TR>

On my own I figured out how to do something like this:

<xsl:variable name="getTotalChars">
                <xsl:value-of select="string-length(.)" />
</xsl:variable>

<xsl:variable name="getLeftChars">
		<xsl:value-of select="($getTotalChars)-20" />
</xsl:variable>

<xsl:variable name="getCharDivision">
                <xsl:value-of select="($getLeftChars mod 25)" />
</xsl:variable>

<xsl:variable name="getLineDifference">
                <xsl:value-of select="(25 - $getCharDivision)" />
</xsl:variable>

<xsl:variable name="getNewAbove">
                <xsl:value-of select="($getLeftChars + $getLineDifference)" />
</xsl:variable>

<xsl:variable name="getWhatNew">
                <xsl:value-of select="substring(.,$getNewAbove,1)" />
</xsl:variable>

<TR><TD colspan="2"><xsl:value-of select="substring(.,0,$getNewAbove)" /></TD></TR>
<TR><TD><xsl:value-of select="substring(.,$getNewAbove)" /></TD><TD></TD></TR>

This is MOSTLY working. I'm not sure if it's the effecient right way to do it, but it was the best I could manage without outside assitance. Here's the problem, it returns this:

<TR><TD colspan="2">a brown dog jumped over a l</TD></TR>
<TR><TD>azy fox who cares</TD><TD></TD></TR>

So I need some way to test the character at the position $getNewAbove. If it's an empty space, then life is good. However if it is a character, I need to reduce the value of $getNewAbove by one, so that the word we've landed in the middle of will rag down into the next row.

Does this make sense? Do you have any suggestions?



heath deforrest allison
"Arrowed!"




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.