Monday, January 5, 2009

XSL Development issues using Jdeveloper

I am listing down some development issues that developers may face while using XSL transformations

Issue #1

In some cases the values from the routing service with OAGIS specific xsd are not getting transferred to another Routing service/BPEL even after mapping all the records using Jdev XSL auto map tool.

Reason

The XSLT map tool of JDEV has a bug where one of the nodes is used without the namespace prefix.

Solution

Do all the required mapping using the XSLT mapper of JDEV. Do required mapping. Cross check couple of times that all nodes are mapped properly. Then go to source add the required namespace-prefix to all the nodes prefix is missing.

For example an OAGIS schema BOD has an ApplicationArea and DataArea .When you map the values from one OAG routing service to another the Jdev tool misses out on adding namespace prefix to DataArea. So always check whether the prefix exists for all the elements. Once you add the namespace-prefixes, the design tab will not work, so always finish all the mappings then only add the namespace-prefix. Given below is the code-snippet which jdev is generating and correct one after modifying the XSL. ApplicationArea values were coming properly because it has proper namespace-prefix. DataArea has no namespace-prefix. So values are not populated.

JDEv XSLT

<ns10:ApplicationArea>

……………

…………………..

</ns10:ApplicationArea>

<DataArea>

<ns10:Get>

<xsl:attribute name="uniqueIndicator">

<xsl:value-of select="/imp1:GetPlanningSchedule/DataArea/imp1:Get/@uniqueIndicator"/>

</xsl:attribute>

……………………..

…………………………

</ns10:Get>

<xsl:for-each select="/imp1:GetPlanningSchedule/DataArea/imp1:PlanningSchedule">

…………………………….

Correct XSLT

<ns10:ApplicationArea>

……………

…………………..

</ns10:ApplicationArea>

<ns10:DataArea>

<ns10:Get>

<xsl:attribute name="uniqueIndicator">

<xsl:value-of select="/imp1:GetPlanningSchedule/imp1:DataArea/imp1:Get/@uniqueIndicator"/>

</xsl:attribute>

…………………………………………..

……………………………………..

</ns10:Get>

<xsl:for-each select="/imp1:GetPlanningSchedule/imp1:DataArea/imp1:PlanningSchedule">

Issue #2

Sometimes the changes made to the existing XSL are not reflecting in the ESB.

Reason

The metadata server/runtime server cache is not getting updated properly. This is a bug

Solution

If you making changes try to use a new mapping file(XSL) everytime. (risk free)Then copy the content from old xsl to the new one and then add new changes required to the XSL.

1 comment:

SeaGate said...

Hi,

You wrote:

>>
Solution

If you making changes try to use a new mapping file(XSL) everytime. (risk free)Then copy the content from old xsl to the new one and then add new changes required to the XSL.
>>

Sometimes disable/enable ESB service helps in this situation.
Also I didn't faced this issue since 10.1.3.3 MLR#17

Regards,
Mikhail.