XSLT 1 Plain Text Spacing

Posted by justkt on Stack Overflow See other posts from Stack Overflow or by justkt
Published on 2010-05-17T15:46:27Z Indexed on 2010/05/17 15:50 UTC
Read the original article Hit count: 189

Filed under:
|
|
|
|

Using Perl's XML::LibXSLT necessitates that I use XSLT 1.0, which means that I am stuck without XSLT 2.0 features. Is there a way that I can still pad text cleanly in a plain-text output from my processing? What I want is:

<values>
    <headers>
        <header>Header 1</header>
        <header>Header 2</header>
    </headers>
    <value>
        <one>First value 1</one>
        <two>First value 2</two>
    </value>
    <value>
        <one>Second value 1</one>
        <two>Second value 2</two>
    </value>
    ....
    <value>
        <one>Nth value 1</one>
        <two>Nth value 2</two>
    </value>
</values>

To become

Header 1          Header 2
First value 1     First value 2
Second value 1    Second value 2
....
Nth value 1       Nth value 2

I realize that XSLT isn't necessarily ideally suited for this type of formatting, but the data will likely also be formatted in other ways.

© Stack Overflow or respective owner

Related posts about xslt-1.0

Related posts about libxslt