cancel
Showing results for 
Search instead for 
Did you mean: 

Using XSL Transformation in Business Logic Transaction

Former Member
0 Kudos

Has anyone used XSL Transformations in BLT? If so, how do you set the parameters?

Using XSL Transformation in a Query you can easily set the parameter name and value on the Transform tab. But how do you accomplish this same thing in a transaction?

Thanks for any help.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Lori,

It's not straightforward in BLS but here's what you need to do...

1) Use an XML Loader action to load the XSL Transformation

2) On the outgoing tab of the XML Loader, assign the values for your XSL params

3) Assign the entire XML of the XML Loader to the input XML of the XSL Transformation action block.

On excecution, your params will be properly set.

Regards,

Michael Teti

Former Member
0 Kudos

Okay, so far so good until it came to setting the params.

I am using the InterpolatedValues transformation and need to assign the following parameters and values:

ColumnID=BusActivity

RowID=Month_Year

ValueID=CycleTime

UseZero=Y

Do you know where in the stylesheet these get assigned and the proper syntax? Are they defined as name/value pairs?

I have also see the parameters referred to as:

XParamName.1=ColumnID&XParamValue.1=BusActivity

Former Member
0 Kudos

Lori

Goto the Outgoing tab of the XML Loader. Expand XMLContent so you are able to view the nodes under the xsl:stylesheet node.

Under each xsl:param node will be the name attribute. If you hover your mouse over that name attribute, it will identify the param's name. Once you identify the appropriate xsl:param, click on "xsl:param" (not the name attribute) and enter the value in expression field" The Target xPath will be defined as XmlLoader_0.XmlContent{/xsl:stylesheet/xsl:param}.

You will have to adjust it to look:

XmlLoader_0.XmlContent{/xsl:stylesheet/xsl:param[x]}

where x is position number in the xsl:params array (starting with 1). For example, in InterpolatedValues.xsl, the ColumnID param is

XmlLoader_0.XmlContent{/xsl:stylesheet/xsl:param[1]}

Regards,

Michael Teti

Former Member
0 Kudos

Lori

Goto the Outgoing tab of the XML Loader. Expand XMLContent so you are able to view the nodes under the xsl:stylesheet node.

Under each xsl:param node will be the name attribute. If you hover your mouse over that name attribute, it will identify the param's name. Once you identify the appropriate xsl:param, click on "xsl:param" (not the name attribute) and enter the value in expression field" The Target xPath will be defined as XmlLoader_0.XmlContent{/xsl:stylesheet/xsl:param}.

You will have to adjust it to look:

XmlLoader_0.XmlContent{/xsl:stylesheet/xsl:param[x]}

where x is position number in the xsl:params array (starting with 1). For example, in InterpolatedValues.xsl, the ColumnID param is

XmlLoader_0.XmlContent{/xsl:stylesheet/xsl:param[1]}

Regards,

Michael Teti

Former Member
0 Kudos

Lori

Goto the Outgoing tab of the XML Loader. Expand XMLContent so you are able to view the nodes under the xsl:stylesheet node.

Under each xsl:param node will be the name attribute. If you hover your mouse over that name attribute, it will identify the param's name. Once you identify the appropriate xsl:param, click on "xsl:param" (not the name attribute) and enter the value in expression field" The Target xPath will be defined as XmlLoader_0.XmlContent{/xsl:stylesheet/xsl:param}.

You will have to adjust it to look:

XmlLoader_0.XmlContent{/xsl:stylesheet/xsl:param[x]}

where <i>x</i> is position number in the xsl:params array (starting with 1).

For example, in InterpolatedValues.xsl, the ColumnID param is

XmlLoader_0.XmlContent{/xsl:stylesheet/xsl:param[1]}

Regards,

Michael Teti

Former Member
0 Kudos

Or better yet, don't use XSLT at all...

If you have to use it, there is a servlet called IllumXSLTServlet that can be used to perform the transformation (including passing of parameters) via a URL request. This could easily be invoked using one of the "*Loader" (XMLLoader, HTMLLoader, TextLoader, etc.) actions in BLS.

http://help.sap.com/saphelp_xmii115/helpdata/en/Advanced_Topics/Customizing_Output/Illuminator_XSLT_...

Former Member
0 Kudos

Thank you Michael, this is great I never would have figured this out.

I assigned all my params now and when I execute I get an error in the XSL Transformation action block stating the following:

XSLTransform Error: Cannot find the script or external object that implements prefix 'xalan'.

Any ideas?

Former Member
0 Kudos

Lori,

I tried to simulate your issue but was not successful. Everything worked as expected. Did you make any changes to your XSLT file?

One thing I think I forgot to mention is that is important that the XSL file path in the configuration dialog should NOT be set. If it is, it will oversride any InputXSL that you have set from the Link Editor. This is not the norm for action block in BLS.

Regards,

Michael Teti

Former Member
0 Kudos

OK, I see in the documentation that the URL should look like

http://<servername>/Lighthammer/Illuminator/IllumXSLTServlet?URL=<XML doc OR URL reference>&Transform=<XSLReference>

I've done the obvious replacing the <servername> with my servername and

I've tryed many different combinations of this having the XML doc/URL in <gt&lt>, "double Quotes", 'single quotes', nothing and the URL being absolute using the server name, local host, relative...

{I've also done the same to the Transform="Reference" portion. but all I get back is:

Fatal Error

An invalid Server was used (IlluminatorService).

Anyone have a sample that works???

Former Member
0 Kudos

The error message "An invalid Server was used (IlluminatorService)." indicates that xMII can not find the query template or you have specified an incorrect query template or the data server for the query template is not enabled.

Former Member
0 Kudos

I am having the exact same problem as Lori -- getting the error "XSLTransform Error: Cannot find the script or external object that implements prefix 'xalan'.". I use the very same transform from a query template all the time and it works fine. I am NOT an xsl programmer so I don't understand most of this but there are settings in the xsl transform file that say xmlns:xalan="http://xml.apache.org/xalan" and exclude-result-prefixes="xalan java". It seems that this xalan reference is the issue but I don't know what to do about it. I would be thrilled to get this transformation working in BLS. Thanks!