cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT Question

Former Member
0 Kudos

Hi guys,

I'm following Michal web log "XML node into a string with graphical mapping?" and I'm trying to use a variable that brings me the interface name for I can use this xslt program for each mapping that I have.

I just check the xslt runtime constants on help.sap.com and I declared the parameter name just sap help shows! But when I test it on tcode xslt_tool it doesn’t work and in debug I can’t see any value for my $Interface runtime constant.

My code:

[code] <xsl:param name="Interface"/>

<xsl:strip-space elements="*"/>

<xsl:template match="/">

<sendTO>

<arg1>

<xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>

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

<xsl:text disable-output-escaping="yes">]]</xsl:text>

<xsl:text disable-output-escaping="yes">></xsl:text>

</arg1>

</sendTO>[/code]

Anyone knows where is my mistake?

Thanks in advance,

Ricardo.

Accepted Solutions (0)

Answers (1)

Answers (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

can yout try testing the whole flow?

with your mapping and not the debugging only?

refere to:

"In the same way as in Java mappings, the mapping runtime in XSLT programs also returns parameters that you can use to evaluate information in the XSLT program that is not known <b>until runtime</b>"

from help.sap.com

maybe you can only see those when you debug

the message mapping (as you can fill them

on the separate tab)

BTW

you can also use:

<xsl:value-of select="$Interface" />

to get the value

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Former Member
0 Kudos

Hi,

It still doesn't work also if I test the whole flow in my mapping. I don't have sure if the code is right! I did many changes in the code, but it still doesn't work...

Anybody knows how to call a runtime constant in xslt program?

Thanks in advance,

Ricardo.

MichalKrawczyk
Active Contributor
0 Kudos

did you try with value of like in my reponse?

Regards,

michal

Former Member
0 Kudos

Yes,

And we can test it with sxi_mapping_test transaction without execute the whole scenario.

But now I realize that I don’t need the interface name, but the root element of my outbound interface (message type) to put the whole xml into a string dynamically.


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

<<b>ns0:P1100_val</b> xmlns:ns0="http://switching/xi">
   <R000000>
      <R00000010/>

I just want to take the value on bold… How can I read the payload and catch the root element.

Thanks a lot for your precious help

Ricardo.

Message was edited by: Ricardo Quintino

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

use this:

<xsl:value-of select="namespace::ns0"/>

>>>And we can test it with sxi_mapping_test transaction without execute the whole scenario.

BTW

I've told you this may not work - you need a whole flow

for runtime parameters

Regards,

michal

Former Member
0 Kudos

Hi,

The result is empty:

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

<sendTO xmlns:ns0="http://switching/xi">

<arg1>

<![CDATA[ ]]>

</arg1>

</sendTO>

Regrads,

Ricardo.

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

can you paste your xml ?

Regards,

michal

Former Member
0 Kudos

of course

<?xml version="1.0" encoding="utf-8" ?> 
<ns0:P1100_val xmlns:ns0="http://switching/xi">
<R000000>
  <R00000010>R000000</R00000010> 
  <R00000020>I</R00000020> 
  <R00000030>0002</R00000030> 
  <R00000040>2</R00000040> 
  <R00000050>0002</R00000050> 
  <R00000060>1</R00000060> 
  <R00000070>0001</R00000070> 
  <R00000080>2</R00000080> 
  <R00000090>2000220069000000084</R00000090> 
  <R00000100>20060605105803</R00000100> 
  <R00000110>01.02</R00000110> 
  <R00000120>A012</R00000120> 
  <R00000130>P1100</R00000130> 
  <R00000140>1</R00000140> 
  <R00000150>111111111111111111DP</R00000150> 
  <R00009000>20060605110325</R00009000> 
</R000000>
<R110000>
  <R11000010>R110000</R11000010> 
  <R11000020>1</R11000020> 
  <R11000025>N</R11000025> 
  <R11000030>3423</R11000030> 
</R110000>
<R999900>
  <R99990010>R999900</R99990010> 
  <R99990020>3</R99990020> 
</R999900>
</ns0:P1100_val

>

Regards,

Ricardo.

MichalKrawczyk
Active Contributor
0 Kudos

hi,

I only managed to do it like this:

<?xml version='1.0' ?>

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

<xsl:template match="/">

<sendTO>

<arg1>

<xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[]]></xsl:text>

<xsl:value-of select="ns0:P1100_val/namespace-uri()"/>

<xsl:text disable-output-escaping="yes"><![CDATA[]]]]></xsl:text>

<xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>

</arg1>

</sendTO>

</xsl:template>

</xsl:stylesheet>

but try the runtime constants<b> in the FLOW</b>

real one (<b>not test transactions</b>)

Regards,

michal

Former Member
0 Kudos

sorry Michal,

I don't want the namespace but the name of messagetype. (is in bold)


<?xml version="1.0" encoding="UTF-8"?>
<<b>ns0:P1100_val</b> xmlns:ns0="http://switching/xi"> 
<R000000>
<R00000010/>

Thanks again,

Ricardo.

Message was edited by: Ricardo Quintino

Former Member
0 Kudos

Hi Michal,

First, thanks a lot for your helpful answers

I have another doubt! I would like to config my soap adapter module like you did in your weblog.

How can I do that? What is SAP standard Bean (MessageTransformBean)?

Can you provide me some clues?

Regards,

Ricardo.

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

the name of the bean is the same for all adapters:)

also refere to this one

https://weblogs.sdn.sap.com/pub/wlg/3823 [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]

REgards,

michal

Former Member
0 Kudos

Hi Michal,

I’m following the Stefan web log that you gave me and I’m trying to configure a receiver soap adapter. I filled the parameters of the Module adapter and when I save it, the parameters disappear!!! But if I edit again both parameters appear again…

Is it typical? Do you know what’s happening?

Regards,

Ricardo.

MichalKrawczyk
Active Contributor
0 Kudos

hehe are you sure you're Ricardo and not David?

David Copperfield... )

but no, this is not normal they are visible all the time

but since they exist (when you edit)

try executing your scenario and check

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Former Member
0 Kudos

We are having problems with j2ee...

It is save now and I can see all parameters

Regards,

Ricardo.