icon-arrow icon-check icon-mail icon-phone icon-facebook icon-linkedin icon-youtube icon-twitter icon-cheveron icon-download icon-instagram play close close icon-arrow-uturn icon-calendar icon-clock icon-search icon-chevron-process icon-skills icon-knowledge icon-kite icon-education icon-languages icon-tools icon-experience icon-coffee-cup
Werken bij Integration & Application Talents
Blog 26/09/2014

Prevent the JDeveloper XSL mapper from breaking

Prevent from breaking

Who has worked with the Design view of the XSL mapper in Oracle JDeveloper, knows that it works nice for simple mappings and drawing lines from one end to the other. However, when adding more complicated transformations, the moment arrives one has to modify the source. This usually results in mapper errors, and the Design view will not be displayed.

Although it’s not entirely avoidable this will happen at some point, there are a few guidelines for the notation of the XML code that help you use your Design Editor as long as possible.

Take a look at this xml snippet:

<rpy:postalcode>
  <xsl:choose>
    <xsl:when test="$country != 'USA'">
      <xsl:value-of select="$Zip"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="$foreignpostalcode"/>
    </xsl:otherwise>
  </xsl:choose>
</rpy:postalcode>

Althought the XML is perfectly valid, this will break the Design Editor. Why is that? Apparently, the editor doesn’t like the <postalcode> brackets outside of the <xsl:choose> construct. It seems to expect an entire element within the <xsl:when> and <xsl:otherwise> elements. When rewriting it with the <postalcode> brackets inside the construct, the editor still works in Design view:

<xsl:choose>
<xsl:when test=”$country != ‘USA'”>
<rpy:postalcode>
<xsl:value-of select=”$Zip”/>
</rpy:postalcode>
</xsl:when>
<xsl:otherwise>
<rpy:postalcode>
<xsl:value-of select=”$foreignpostalcode”/>
</rpy:postalcode>
</xsl:otherwise>
</xsl:choose>

I’m not sure if it’s desirable to rewrite all your transformations. It adds a lot of element tags, making it less readable. In case you use an <xsl:if> construct which might intendently result in an empty element, it’s even more work. In the end, you have a choice how much effort you want to put in having a visual representation of your transformation.

Overzicht blogs

Geen reacties

Geef jouw mening

Reactie plaatsen

Reactie toevoegen

Jouw e-mailadres wordt niet openbaar gemaakt.

Geen HTML

  • Geen HTML toegestaan.
  • Regels en alinea's worden automatisch gesplitst.
  • Web- en e-mailadressen worden automatisch naar links omgezet.

Wil je deel uitmaken van een groep gedreven en ambitieuze experts? Stuur ons jouw cv!