Maximo Wire - The IBM Maximo Help & Discussion Forum
May 22, 2012, 10:34:14 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to Maximo Wire, the IBM Maximo help forum. Feel free to register and ask any Maximo related questions you like.
 
  Home Help Search Login Register  
*
Pages: [1]   Go Down
  Print  
Author Topic: Problem with XSL file in Maximo  (Read 1201 times)
0 Members and 1 Guest are viewing this topic.
rama26
Newbie
*

Karma: 0
Posts: 1


View Profile
« on: July 17, 2009, 07:12:17 am »

Hi,

I am using an XSL in which I tried to rename the root node. It worked fine when I tested in JDeveloper but it is not working when I placed the xsl in maximo.Here are the input xml and xsl .
<?xml version="1.0" encoding="UTF-8"?>
<MESSAGE>
<ER>...</ER>
<IR>
<MXABCIface xmlns="http://www.mro.com/mx/integration" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" language="EN">
<Header operation="Notify" event="1">....
</Header>
<Content>
... </Content>
</MXABCIface>
</IR>
</MESSAGE>

And xsl is

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:mro="http://www.mro.com/mx/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0" exclude-result-prefixes="mro">

<xsl:template match="/MESSAGE">
<xsl:apply-templates select="IR"/>
</xsl:template>
<xsl:template match="IR">
<xsl:apply-templates select="@*|*|text()"/>
</xsl:template>
<xsl:template match="@*|*|text()">
<xsl:copy>
<xsl:apply-templates select="@*|*|text()"/>
</xsl:copy>
</xsl:template>

<!-- Change the name of the root node from MXABCInterface to MXXYZInterface.
The following code is not working
-->

<xsl:template match="mro:MXABCInterface">
<xsl:element name="MXXYZInterface" namespace="http://www.mro.com/mx/integration">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>


<!-- Rename the Sub to SubRename
This code is working
-->

<xsl:template match="mro:Sub">
<xsl:element name="SubRename" namespace="http://www.mro.com/mx/integration">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>

In the output, 'Sub' is renamed to 'SubRename'. But 'MXABCIface' is not getting renamed to 'MXXYZIface'.

My expected output is
<MXXYZIface...>
<Header operation="Notify" event="1">....
</Header>
<Content>
<SubRename>...</SubRename>
</Content>
</MXXYZIface>.

Can anyone help me out in resolving this isuue..


Thanks and Regards
Rama
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Recent

TinyPortal v1.0 beta 4 © Bloc
Powered by MySQL Powered by PHP Powered by SMF 1.1.15 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!