cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT migration headaches - xalan

Former Member
0 Kudos

Hi All,

Having a few headaches porting an xMII 11.5 application to MII 12.1 that extensively uses XSLTs for HTML generation and am getting headaches from the XSLTs and I've noticed there are lot of xalan function calls in them.

Now in MII 12.1 are we now using SAP XML parser and we are no longer using Apache Xalan?

What options do I have to port these XSLs? Does it require a re-write to something that the SAP XML parser can handle? (I guess standard XSLT 2.0 functions?) or am I able to use the Apache Xalan parser with MII 12.1?

any help would be greatly appreciated..... some example code snippets are:

Searching through SDN a lot of references talk about including these xalan.jar / xercesImpl.jar / xml-apis.jar with their application but I am not sure how this would apply in a MII sense?


<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xalan="http://xml.apache.org/xalan" exclude-result-prefixes="xalan">
	<xsl:output method="xml" media-type="text/xml"/>
	
	<xsl:param name="Param.31"/>
	<xsl:param name="Param.32"/>
	<xsl:param name="SubtotalColumn"/>
	<xsl:param name="DisplayColumns"/>
	<xsl:param name="ShowDetails">Y</xsl:param>
	<xsl:param name="ShowSubtotals">Y</xsl:param>
	<xsl:param name="ShowGrandTotal">Y</xsl:param>
	<xsl:param name="ShowHeaders">Y</xsl:param>

// Lots of code here //

	<xsl:variable name="DetailExpr">/Rowsets/Rowset/Row[<xsl:value-of select="$SubtotalColumnName"/>='<xsl:value-of select="$SelGroup"/>']</xsl:variable>
	<xsl:variable name="SubtotalExpr">/Rowsets/Rowset/Row/<xsl:value-of select="$SubtotalColumnName"/>"/></xsl:variable>
	<!-- Output Details for Each Column -->
	<xsl:if test="$ShowDetails = 'Y'">
	<xsl:for-each select="xalan:evaluate($DetailExpr)">
	<Row>
									<xsl:variable name="CurrentRow" select="."/>
	<xsl:for-each select="$ColumnNames">
										<xsl:variable name="ColName">							<xsl:value-of select="."/>
										</xsl:variable>
										<xsl:variable name="ColExpr">$CurrentRow/<xsl:value-of select="$ColName"/>
										</xsl:variable>
										<xsl:variable name="ColValue">
										<xsl:value-of select="xalan:evaluate($ColExpr)"/>
										</xsl:variable>
										<xsl:element name="{$ColName}">
										<xsl:value-of select="$ColValue"/>
										</xsl:element>
	</xsl:for-each>
	</Row>
	</xsl:for-each>
	</xsl:if>			


Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

From SAP Note 1294013:

MII XSLT stylesheets do not compile properly. This applies to stylesheets that use the 'xalan' namespace and extensions. The Xalan libraries are no longer distributed by MII for 12.1.

Solution

In MII 12.1, the Xalan library no longer come shipped with the product. The Xalan library can be downloaded from the Apache website at http://xml.apache.org/xalan-j/index.html. Version 2.7 was used for testing and can be obtained from the Apache archive directory

http://archive.apache.org/dist/xml/xerces-j/.

The files are placed in the lib/endorsed folder for the JDK that the Netweaver server is using. For example, if you have a Windows machine running NW, the files would be placed in the following directory:

C:\usr\sap\CE1\SYS\exe\jvm\NTI386\sapjvm_5.1.024\sapjvm_5\jre\lib\endorsed. If the endorsed directory is not there, create it under the lib folder and place the following files there:

- serializer.jar

- xalan.jar

- xercesImpl.jar

- xml-apis.jar

- xsltc.jar

Documention regarding the Endorsed Standards Override Mechanism can be found here: http://java.sun.com/j2se/1.5.0/docs/guide/standards/

If you are unsure where the JDK for your server is located, you can use the Configuration Tool to locate it

REMEMBER! If you update Java on the Netveawer platform, you must do this again to the new java library.

BR

Jens

Former Member
0 Kudos

Wow thank you very much this is what I am looking for.....

silly me not being able to find this sap note for myself!

++ points for you!

Answers (1)

Answers (1)

Former Member
0 Kudos

Try putting the jars you need in the servers java classpath.