You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Javier Valdes <ja...@gmail.com> on 2008/12/01 08:49:25 UTC

Problem with output indent in saxon component

Hi,

We are having a problem with the output indent when using the saxon
component. We are using the XSLT endpoint, and our xslt files are as the
following:

<?xml version="1.0"?>
<xsl:stylesheet version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output encoding="ISO-8859-1" indent="yes" />
    <xsl:template match='/'>
        <ack>
            <xsl:apply-templates />
        </ack>
    </xsl:template>
    <xsl:template match='header'>
        <header>
            <id>ACK<xsl:value-of select='id'/></id>
            ...
        </header>
        <body>
             ...
        </body>
    </xsl:template>
    <xsl:template match="text()" />
</xsl:stylesheet>

But the output that we get do not respect the indent, is something like
this:

<ack><header><id>...</header><body>...</body></ack>

Instead of

<ack>
    <header>
        <id>
            ...
        </id>
    </header>
    <body>
        ...
    </body>
</ack>

Can anyone help us?

Thanks.

Re: Problem with output indent in saxon component

Posted by Jeff Peterson <j....@gmail.com>.
Javier,

I think you are experiencing expected behavior.  Both XML documents
you posted are semantically equivalent.  If you want to "pretty-print"
the XML, you will have to do it on your side.

- Jeff

On Sun, Nov 30, 2008 at 11:49 PM, Javier Valdes
<ja...@gmail.com> wrote:
> Hi,
>
> We are having a problem with the output indent when using the saxon
> component. We are using the XSLT endpoint, and our xslt files are as the
> following:
>
> <?xml version="1.0"?>
> <xsl:stylesheet version="2.0"
>    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>    <xsl:output encoding="ISO-8859-1" indent="yes" />
>    <xsl:template match='/'>
>        <ack>
>            <xsl:apply-templates />
>        </ack>
>    </xsl:template>
>    <xsl:template match='header'>
>        <header>
>            <id>ACK<xsl:value-of select='id'/></id>
>            ...
>        </header>
>        <body>
>             ...
>        </body>
>    </xsl:template>
>    <xsl:template match="text()" />
> </xsl:stylesheet>
>
> But the output that we get do not respect the indent, is something like
> this:
>
> <ack><header><id>...</header><body>...</body></ack>
>
> Instead of
>
> <ack>
>    <header>
>        <id>
>            ...
>        </id>
>    </header>
>    <body>
>        ...
>    </body>
> </ack>
>
> Can anyone help us?
>
> Thanks.
>