However, I searched the forums for “xslt” and didn’t find anything specific as to what I’m looking for.
Let’s say I wanted to call the addInts service from the WmPublic package from my xslt stylesheet, how would I go about it? I know there’s other ways to make simple additions, but bear with me for the sake of knowing how to do it.
I tried the example from page 29 of the XSLTServiceDevGuide, using this namespace:
I know there are other ways to do the additions. I picked the addInts from WmPublic because it’s a simple example to use. I could have chosen any other service from the WmPublic package as an example. The goal on my post is really to know how I could call whatever service coming from WmPublic (or another WmXX package) from my xslt stylesheet.
Actually, what would help tremendously is if anobody could give me a hint as to what would be the correct namespace for the math class under WmPublic. For the IntDate example I posted above, the namespace is java://com.wm.pkg.xslt.samples.date.IntDate. It happens that the IntDate.class is in the following directory in our environment:
That’s why I thought that my namespace would be “java://pub.math” but it doesn’t work, probably because it’s not the right namespace. I’ve been searching like crazy for the right namespace but I can’t find it.
No you can’t, because public Built-in services uses Idata as input/output parameters for the methods, and XSLT will use The IOutputMap
interface (com.wm.pkg.xslt.extension.IOutputMap) , and will put values as IOutputMap.put(Object name, Object value) to add name/value pairs to an output object of type IOutputMap.
When you add in the XSLT:
IntDate:getDate(‘2010’,‘07’,‘20’,‘12’,‘12’,‘12’)
That will excute methods getDate passing 6 String arguments, and the method will return a Date object which will be placed in the interface IOutputMap.put(Object name, Object value)
You can build your own Java classes, but not possible using built-in ones.
Well, thanks for clearing that up. I was looking left and right like crazy in trying to make this work. I believe the built-in services like what you can find in the WmPublic are written in Java (which I’m not that familiar with, Java that is) and I figured it could be done. Damn… would have been nice.