Oracle XSLT Transformation not preserving space in text element
panksJul 29 2011 — edited Feb 26 2020If we have a BPEL process which is calling a XSLT transformation contains the code similar as below:
for Populating an element with white space only
<tns:TargetField>
<xsl:text disable-output-escaping="yes"> </xsl:text> <!--Note the whitespace , also tried with disable-output-escaping =”no” -->
</tns: TargetField>
Our expected result / output would be:
<tns:TargetField> </tns: TargetField> <!--Note the whitespace -->
But, we get:
<tns:TargetField/>
Oracle XSLT is ignoring the white space even if we try with preserve space in XSD, or in XSLT this is not producing the expected output.
This looks a BUG with Oracle XSLT Transformation .
For a workaround solution we can use below XSLT snippet:
*<tns:TargetField>*
*<xsl:value-of select="string(' ')"/> <!--Note the whitespace -->*
*</tns:TargetField>*
This is returning Output:
*<tns:TargetField> </tns:TargetField> <!--Note the whitespace -->*
Any other work around do you find?
Edited by: panks on Jul 29, 2011 12:37 PM