cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT mapping help

Former Member
0 Kudos

Hello Experts,

I need to import an external stylesheet (on the web) into my xml file.

I wrote the below xslt code. Although it executes successfully, i do not see the external stylesheet being added to the XML.

<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">

<xsl:import href="http://www.moda-ml.net/moda-ml/repository/xsl/v2004-1/en/TEXDesAdviseEN.xsl" />

<xsl:apply-imports />

<xsl:copy-of select="/" />

</xsl:template>

</xsl:stylesheet>

Do let me know whether there is any error in the code or whether I need to follow some additional steps/processes.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos
Former Member
0 Kudos

Thanyou very much Raj and Stefen.

Raj: I can do what you have suggested but the problem is the xsl on the web again calls another xsl and so on. So I would need to do it multiple times, which I wanted to avoid.

Stefen: It worked. It was exactly what I was looking for. Thankyou.

I have an additional requirement in the xsl transformation now. If you could please help on it too.

I need to change the name of the node ns0:TEXDesAdvice to ml:TEXDesAdvise and add attributes. Below are my input and expected output.

input:

<?xml version="1.0" encoding="UTF-8"?>

<ns0:TEXDesAdvise>

<data segments>

</data segments>

</ns0:TEXDesAdvise>

output:

<?xml version="1.0" encoding="UTF-8"?>

<ml:TEXDesAdvise TAtype="STD" msgfunction="OR"

<data segments>

</data segments>

</ml:TEXDesAdvise>

Thanks in Advance.

former_member200962
Active Contributor
0 Kudos

Make use of XMLAnonymizerBean to get the desired namespace prefix....Stefan has a blog on the same topic.

If you want to do it using XSLT itself, then there may be a reference on SDN itself.....a search would help you.

Regards,

Abhishek.

Answers (1)

Answers (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

Try to downlaod the XSLT from the website and add this to your imported archieve folder,then execute it.

it will work,i am not sure that calling extenal reference XSL in mapping will work , even i had done like that only in my requirement.

Regards,

Raj