[xep-support] Need to evaluate string-lengths for a set of nodes--how?

From: Blankner, Sherrod (Sherrod.Blankner@schwab.com)
Date: Tue Aug 10 2004 - 11:11:25 PDT

  • Next message: Dean, Tim (STP): "RE: [xep-support] Padding within cells of proportional-width table columns?"

            Can anyone out there help me brainstorm some logic for a letter
    recipient name:

            We have a simple letter XSL that processes the following XML to fill
    in the recipient name
            <names>
                    <name>John Doe</name>
                    <name>Jane Doe</name>
                    <name>Jim Doe</name>
                    </names>

            Currently our XSL is very straight forward

                            <fo:block>
                                    <xsl:for-each select="names/name">
                                            <fo:block>
                                                    <xsl:value-of select="."/>
                                            </fo:block>
                                    </xsl:for-each>
                                    </fo:block>

    However, with the new window size in the envelope, we can't stack names
    indefinitely--we only have 6 lines for the total address, with a maximum of
    three name lines if the address is in the US. I need logic that evaluates
    whether the string length of a set of <name> tags is more than 61
    characters, at which point I want to cut off and print just those names into
    line 1. Then I need to start where line 1 left off and evaluate the next set
    of <name> tags and see if these add up to under 61 characters, at which
    point I can write in line 2, etc. I have three possible lines.

    Does anyone have any suggestions?
    I've been working with the string-length function, but I can't seem to get
    it to increment up inside a for-each loop. I also messed around with some
    param/call-templates functions but got the same result.

    Thanks
    Sherrod

    Sherrod Blankner
    CRS Digital Studio
    ---------------------------------------------------
    120 Kearny, 11th Floor
    Desk: 415-636-5181
    Cell: 415-225-9159
    ---------------------------------------------------

    -------------------
    (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
    in the body of the message to majordomo@renderx.com from the address
    you are subscribed from.
    (*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html



    This archive was generated by hypermail 2.1.5 : Tue Aug 10 2004 - 11:26:59 PDT