Search code examples
xsltsoabpeloracle-soa

XSLT - New Line/Carriage Return not displaying when deployed (Oracle SOA 11g)


I have an XSL Style Sheet that is supposed to transform an XML into plain text using Oracle SOA 11g BPEL transformation. The plain text transformation is working fine, but whenever I try to add a new line or carriage return, the text output doesn't reflect that. I've tried several ways of adding the line break but none of them have worked. This is the XSLT I'm using for testing purposes:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="urn:oracle:b2b:X12/V4010/850" version="1.0">

<xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
<xsl:template match="/a:Transaction-850">

  <!-- New line -->
  <xsl:variable name='newline'><xsl:text>
    </xsl:text></xsl:variable>

  <xsl:value-of select="a:Internal-Properties/a:Data-Structure/a:Property[@Name='InterchangeUsageIndicator']" />

  <xsl:text>&#xd;</xsl:text>
  <xsl:value-of select="$newline" />
  <xsl:text>&#xA;</xsl:text>
  <xsl:text>&#13;</xsl:text>
  <xsl:text>&#10;</xsl:text>
  <xsl:text>2000ITITM</xsl:text>

</xsl:template>

</xsl:stylesheet>

When I try it out in an online XSLT test tool, it gives the output as expected:

P




2000ITITM

When I deploy the composite, I noticed that the XSLT in the MDS repository ignores the line breaks, &#xAs, etc. and just closes the <xsl:text/> tags:

<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="urn:oracle:b2b:X12/V4010/850" version="1.0">
<xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
<xsl:template match="/a:Transaction-850">
  <xsl:variable name="newline">
    <xsl:text/>
  </xsl:variable>
  <xsl:value-of select="a:Internal-Properties/a:Data-Structure/a:Property[@Name='InterchangeUsageIndicator']"/>
  <xsl:text/>
  <xsl:value-of select="$newline"/>
  <xsl:text/>
  <xsl:text/>
  <xsl:text>2000ITITM</xsl:text>
</xsl:template>
</xsl:stylesheet>

And so, because of that, it just gives me the following output:

P2000ITITM

I have no idea why it's ignoring the new line characters, so any guidance would be appreciated.

Thank you all for your help and time!


Edit: I tried concatenating as follows:

<xsl:value-of select="concat('36','&#xA;')"/>
<xsl:value-of select="concat('24','&#xD;')"/>

...which shows up as is when I look at it in the MDS repository, however the text output still shows no line breaks...


Solution

  • Ah I'm such a newbie. :s I was able to do it with the following:

    <xsl:variable name="newline" select="'&#xD;&#xA;'" />
    

    This would display correctly in the MDS repository too.