cancel
Showing results for 
Search instead for 
Did you mean: 

A doubt XSLT Mapping

ernesto_cruz
Participant
0 Kudos

Hi Guys,

              I am learning XSLT mapping from article

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/000ee4d0-be91-2d10-8aaf-ff8045bdd...

I have created two message type, a service interface in the same SWC, The operation mapping was created in a distinct SWC. Later the test, my target message has two namespaces, the ns0xxxx and ns1xxxx.

In the code, I have

 

xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://xxx" xmlns:ns1=http://xxx

Is correct this? or my target message should have a namespace only?

Regards

Accepted Solutions (1)

Accepted Solutions (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

XSL mapping adding one ns1 tag name space but that is fine,no issues. XML name space and PI name sapce.

Answers (2)

Answers (2)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Just Few cents.... IMO, there are two errors in your namespace declaration.

xmlns  -> attribute

ns1 or ns0 -> namespace prefix

a) You forgot to add quote for the namespace  i.e xmlns:ns1= "http://xxx"

b) if your namespace "http://blah...blah" is different then you can use different namespace prefix either ns1 or ns2 or ns3. Here you use the same namespace, so you don't need different namespace prefix.

Hope that helps.

ernesto_cruz
Participant
0 Kudos

Thanks Baskar,

                         so my code is

Regards.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Yes the above code looks correct. You can also validate for syntax issues (if any) using XMLSPY or some other tool.

iaki_vila
Active Contributor
0 Kudos

Hi Ernesto,

xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://xxx" xmlns:ns1=http://xxx

It's totally correct but it is inneccesary the ns0 namespace in your first image because with the ns1 namespace you are pointing what is the tag namespace . It's easy to delete it with XSL or with module adapter.

Regards.

ernesto_cruz
Participant
0 Kudos

Hi Iñaki,

             thanks for your response, my next goal is delete this namespace from XSLT code.

Regards.

iaki_vila
Active Contributor
0 Kudos

Hi Ernesto,

You can delete one namespace easly in the XSL transformation:

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

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http..." xmlns:ns1="..." exclude-result-prefixes="ns0">

...

</xsl:stylesheet>

Regards and good luck

ernesto_cruz
Participant
0 Kudos

Hi Iñaki,

            I appreciated your help and I need a tutorial for learn the use of command as for example

exclude-result-prefixes="xxx" among others.

Thanks in advance.

Former Member
0 Kudos

Hi,

Refer this ( i have learnt and created above article referring below links 😞

http://www.w3schools.com/xsl/el_stylesheet.asp

http://www.w3schools.com/xsl/

Thanks

Amit