Breaking up a long element

Discussion in 'XML' started by Doug, Jun 1, 2004.

  1. Doug

    Doug Guest

    I'm using XSLT to convert an XML document into a text file for
    processing on our mainframe. I've got everything working fine except
    for one issue.

    One of the elements returned can contain a large amount of data (2K+)
    in size. Here's an example:

    <jurisdictionssearched display="yes">Alaska Courts,Arizona
    Corrections,Arizona Courts,Arkansas Courts,California Court
    Index,Connecticut Corrections,Connecticut Courts,Connecticut Traffic
    Court,District of Columbia Corrections,Florida Broward County,Florida
    Corrections,Florida Duval County,Florida Palm Beach County,Florida
    Pinellas County,Florida Suwannee County,Foreign National,Georgia
    Corrections,Idaho Corrections,Illinois Archived Corrections,Illinois
    Cook County,Illinois Corrections,Indiana Corrections,Iowa
    Corrections,Kansas Corrections,Kansas Sedgwick County,Kentucky
    Corrections,Maine Corrections,Michigan Corrections,Minnesota
    Corrections,Minnesota Courts,Mississippi Corrections,Mississippi Hinds
    County,Missouri Corrections,Montana Corrections,Multi-State Sex And
    Violent Offender,Nebraska Corrections,Nevada Archived
    Corrections,Nevada Corrections,New Jersey Archived Corrections,New
    Jersey Corrections,New Jersey Courts,New York Corrections,North
    Carolina Corrections,North Carolina Courts,Ohio Corrections,Oklahoma
    Corrections,Oregon Clackamas County,Oregon Columbia County,Oregon Coos
    County,Oregon Corrections,Oregon Deschutes County,Oregon Douglas
    County,Oregon Hood County,Oregon Jackson County,Oregon Josephine
    County,Oregon Klamath County,Oregon Lane County,Oregon Lincoln
    County,Oregon Linn County,Oregon Marion County,Oregon Multnomah
    County,Oregon Umatilla County,Oregon Washington County,Oregon Yamhill
    County,Rhode Island Courts,South Carolina Corrections,Tennessee
    Corrections,Tennessee Courts,Texas Courts,Texas Sex Offender
    Registry,Utah Corrections,Utah Courts,Virginia Courts,Virginia Fairfax
    Circuit Court,Virginia Fairfax County Archived District Court,Virginia
    Traffic Courts,Washington CLJ Courts,Washington Corrections,Washington
    Superior Courts,Wisconsin Corrections,Wisconsin
    Courts</jurisdictionssearched>

    I'm not fluent in XML/XSLT so the way I work with stuff is pretty
    basic. Is there a way to break this mass up into separate lines (CRLF
    delimited) of a particular length, say 80 bytes long - could be 100,
    256, whatever. Whether it breaks in the middle of a word doesn't
    matter. Once it's broken up, I can rebuild it on the mainframe. The
    line length is an issue. I'd like to keep it under 500 bytes if
    possible.

    Thanks,
    Doug
     
    Doug, Jun 1, 2004
    #1
    1. Advertising

  2. Doug wrote:

    > I'm using XSLT to convert an XML document into a text file for
    > processing on our mainframe. I've got everything working fine except
    > for one issue.
    >
    > One of the elements returned can contain a large amount of data (2K+)
    > in size. Here's an example:
    >
    > <jurisdictionssearched display="yes">Alaska Courts,Arizona
    > Corrections,Arizona Courts,Arkansas Courts,California Court
    > Index,Connecticut Corrections,Connecticut Courts,Connecticut Traffic
    > Court,District of Columbia Corrections,Florida Broward County,Florida
    > Corrections,Florida Duval County,Florida Palm Beach County,Florida
    > Pinellas County,Florida Suwannee County,Foreign National,Georgia
    > Corrections,Idaho Corrections,Illinois Archived Corrections,Illinois
    > Cook County,Illinois Corrections,Indiana Corrections,Iowa
    > Corrections,Kansas Corrections,Kansas Sedgwick County,Kentucky
    > Corrections,Maine Corrections,Michigan Corrections,Minnesota
    > Corrections,Minnesota Courts,Mississippi Corrections,Mississippi Hinds
    > County,Missouri Corrections,Montana Corrections,Multi-State Sex And
    > Violent Offender,Nebraska Corrections,Nevada Archived
    > Corrections,Nevada Corrections,New Jersey Archived Corrections,New
    > Jersey Corrections,New Jersey Courts,New York Corrections,North
    > Carolina Corrections,North Carolina Courts,Ohio Corrections,Oklahoma
    > Corrections,Oregon Clackamas County,Oregon Columbia County,Oregon Coos
    > County,Oregon Corrections,Oregon Deschutes County,Oregon Douglas
    > County,Oregon Hood County,Oregon Jackson County,Oregon Josephine
    > County,Oregon Klamath County,Oregon Lane County,Oregon Lincoln
    > County,Oregon Linn County,Oregon Marion County,Oregon Multnomah
    > County,Oregon Umatilla County,Oregon Washington County,Oregon Yamhill
    > County,Rhode Island Courts,South Carolina Corrections,Tennessee
    > Corrections,Tennessee Courts,Texas Courts,Texas Sex Offender
    > Registry,Utah Corrections,Utah Courts,Virginia Courts,Virginia Fairfax
    > Circuit Court,Virginia Fairfax County Archived District Court,Virginia
    > Traffic Courts,Washington CLJ Courts,Washington Corrections,Washington
    > Superior Courts,Wisconsin Corrections,Wisconsin
    > Courts</jurisdictionssearched>
    >
    > I'm not fluent in XML/XSLT so the way I work with stuff is pretty
    > basic. Is there a way to break this mass up into separate lines (CRLF
    > delimited) of a particular length, say 80 bytes long - could be 100,
    > 256, whatever. Whether it breaks in the middle of a word doesn't
    > matter. Once it's broken up, I can rebuild it on the mainframe. The
    > line length is an issue. I'd like to keep it under 500 bytes if
    > possible.


    XSLT/XPath works on characters not bytes. You can use XPath functions
    like substring to break up a string into smaller parts.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jun 1, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Amy
    Replies:
    0
    Views:
    519
  2. George Marsaglia

    Assigning unsigned long to unsigned long long

    George Marsaglia, Jul 8, 2003, in forum: C Programming
    Replies:
    1
    Views:
    707
    Eric Sosman
    Jul 8, 2003
  3. Daniel Rudy

    unsigned long long int to long double

    Daniel Rudy, Sep 19, 2005, in forum: C Programming
    Replies:
    5
    Views:
    1,218
    Peter Shaggy Haywood
    Sep 20, 2005
  4. Mathieu Dutour

    long long and long

    Mathieu Dutour, Jul 17, 2007, in forum: C Programming
    Replies:
    4
    Views:
    495
    santosh
    Jul 24, 2007
  5. Bart C

    Use of Long and Long Long

    Bart C, Jan 9, 2008, in forum: C Programming
    Replies:
    27
    Views:
    828
    Peter Nilsson
    Jan 15, 2008
Loading...

Share This Page