Skip to Content
0
Nov 17, 2005 at 11:04 AM

XSLT problem with Carriage return in Web Dynpro

78 Views

My problem is:

In java application, I can tranform the xml file into another format with a certain stylesheet(XSL file) properly. But when I use the same code and the same XSL file to do the transformation in Web Dynpro, it outputs the wrong result, in which all the <b>Carriage Return disappears</b>.

Here is the example:

-Input file (source.xml) -

<?xml version="1.0"?>

<?xml-stylesheet type='text/xsl'>

<List>

<Name age="20">Sandy</Name>

<Name age="23">Sue</Name>

<Name age="18">Billy</Name>

</List>

-XSL file -

<?xml version="1.0"?>

http://www.w3.org/1999/XSL/Transform">

<xsl:output method="text"/>

<xsl:variable name="newline">

<xsl:text>&#xA;</xsl:text>

</xsl:variable>

<xsl:variable name="space">

<xsl:text> </xsl:text>

</xsl:variable>

<xsl:template match="/">

<xsl:for-each select="List/Name">

<xsl:value-of select="."/>

<xsl:value-of select="$space"/>

<xsl:value-of select="@age"/>

<xsl:value-of select="$newline"/>

</xsl:for-each>

</xsl:template>

</xsl:stylesheet>

In java app:

-Output file (DesJava.txt) ->(Right result)

Sandy 20

Sue 23

Billy 18

In Web Dynpro:

-Output file (DesWebDynpro.txt) ->(Wrong result)

Sandy 20Sue 23Billy 18

All above shows, in Web Dynpro the Carriage Return symbol is dismissed.

Anybody know the reason and the solution to solve this problem?

Thanks