cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT Mapping

Former Member
0 Kudos

Hello,

I want to import xslt mappings from TIBCO to XI.

The xsl sheet contains following tags:

<lxslt:component prefix="abc" functions="abc">

<lxslt:script lang="javascript"> <!-- java script here---></lxslt:script>

</lxslt:component>

Do I need to have additional settings or to import additional libraries in XI to support this?

Thanks in advance.

Beena.

Accepted Solutions (1)

Accepted Solutions (1)

iaki_vila
Active Contributor
0 Kudos

Hi Beena,

I think you have two solutions:

a) To adapt the XSL TIBCO to standar XSL.

b) To find java librerires to support TIBCO xsl (¿?) and make a java mapping.

Regards.

Former Member
0 Kudos

Thanks Inaki,

I tried importing this xsl in XI with

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:lxslt="http://xml.apache.org/xslt" xmlns:rri="http://abc" extension-element-prefixes="abc" exclude-result-prefixes="abc">

but it gives error: Unable to find resource http://abc.class in the following software component version.

Is this because when I call function in javascript as abc:func1 It tries to find the function in the resource defined during namespace declaration.

Then how should I call functions of Javascript in xsl or I will have to write all java functions in class only?

Is it possible to import xsl with javascript in xi ?

In Exchange Profile there is a parameter which has description :

com.sap.aii.mapping.transformerFactory :

Customers may want to use a different XML/XSLT engine such as XALAN/Xerces for processing mappings.

Do I need to use this to process such xsls.

Please help ....

Thanks,

Beena.

Former Member
0 Kudos

Hi Bina,

Yes. You can call javascript function in xslt...I have done this...but could not find the code...

But you can refer this site...meanwhich I'll check for code as well..which I had written..

http://www.ibm.com/developerworks/xml/library/x-tipxsltjs/

Nilesh

Former Member
0 Kudos

Nilesh,

Thanks for reply.

I have written code similar to the one in link.

But it gives error that Unable to find resource http://www.example.com/results.class in software component.

Do I need to any changes or add additional jars to import xsl in XI?

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

xmlns:lxslt="http://xml.apache.org/xslt"

xmlns:result="<b>http://www.example.com/results</b>"

extension-element-prefixes="result"

version="1.0">

<lxslt:component prefix="result" elements="rules" functions="getResult">

<lxslt:script lang="javascript">

function getResult (thisGuess) {

var thisResult = parseInt(Math.random()*100);

if (thisResult == parseInt(thisGuess)) {

return "Correct!";

} else {

return "Wrong! The actual answer was "thisResult

", not "thisGuess".";

}

}

</lxslt:script>

</lxslt:component>

<xsl:template match="/">

<xsl:apply-templates/>

</xsl:template>

</xsl:stylesheet>

Thanks,

Beena.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Beena,

As far my knowledge goes you need to have two jar files for handling scripts.

1. bsf.jar

2. js.jar

Now bsf.jar should come with java and you can download js.jar from the below..

<a href="http://www.mozilla.org/rhino/">http://www.mozilla.org/rhino/</a>

For testing away from XI these transformations you need XALAN Processor for Java extensions.

And I dont think XML Spy comes with inbuilt XALAN processor.

Try importing the above jar files and check in XI it should help, otherwise you will have to avoid the Javascript and handle the validations on your own.

Let me know how you tackled this issue.

Also forgot to add, you check the below link for more.

http://www.informit.com/articles/article.aspx?p=31449&seqNum=5

Regards,

Message was edited by:

SriHari Bandi