Follow Us on Twitter

Prevent the JDeveloper XSL mapper from breaking

by Patrick Sinke on September 26, 2014 · 0 comments

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.

Prevent the JDeveloper XSL mapper from breaking, 3.5 out of 5 based on 2 ratings
Ratings:
VN:F [1.9.22_1171]
Rating: 3.5/5 (2 votes cast)

{ 0 comments… add one now }

Leave a Comment

 

Previous post:

Next post:

About Whitehorses
Company profile
Services
Technology

Whitehorses website

Home page
Whitebooks
Jobs

Follow us
Blog post RSS
Comment RSS
Twitter