Forum Stats

  • 3,758,242 Users
  • 2,251,358 Discussions
  • 7,870,124 Comments

Discussions

how to convert when someone type 'null' instead of a string it convert to ' ' (empty string)

3741383
3741383 Member Posts: 20

hello good day everyone,

i have a question so the Quality Control usually test case using input "null" then in their database they want to be an empty string, not a string with "null" value

how do i can convert that in BPEL? do i have to use java embedded to do that? or i can change using assign method?

im using jdev 11.9

regards,

Fajar Ramadhan R

Best Answer

  • vladodias
    vladodias Member Posts: 2,282
    edited Sep 24, 2018 10:28PM Accepted Answer

    Hi,

    I had a similar case in the past and I resolved with a generic XLST transformation like below... it will replace any entry with string 'NULL' in the XML with an empty string...

    Note that the template below will also right-trim the text entries...

        <xsl:template match="node()">

          <xsl:copy><xsl:apply-templates/></xsl:copy>

        </xsl:template>

        <xsl:template match="text()">

          <xsl:if test="xp20:upper-case(oraext:right-trim(oraext:left-trim(.))) != 'NULL'">

            <xsl:value-of select="oraext:right-trim(.)" />

          </xsl:if>

        </xsl:template>

    Cheers,

    Vlad

Answers

  • vladodias
    vladodias Member Posts: 2,282
    edited Sep 24, 2018 10:28PM Accepted Answer

    Hi,

    I had a similar case in the past and I resolved with a generic XLST transformation like below... it will replace any entry with string 'NULL' in the XML with an empty string...

    Note that the template below will also right-trim the text entries...

        <xsl:template match="node()">

          <xsl:copy><xsl:apply-templates/></xsl:copy>

        </xsl:template>

        <xsl:template match="text()">

          <xsl:if test="xp20:upper-case(oraext:right-trim(oraext:left-trim(.))) != 'NULL'">

            <xsl:value-of select="oraext:right-trim(.)" />

          </xsl:if>

        </xsl:template>

    Cheers,

    Vlad

This discussion has been closed.