Hi everybody.
Before I ask a question, please let me explain the problem.
I'd like to send to stylesheet variable number of parameters, which would be then resolved by
proper stylesheet. For example I have a number of parameters defined in XML file (can be
_any_ number of parameters):
<Params>
<Param nm="t1" vl="11"/>
<Param nm="t2" vl="22"/>
</Params>
I want to transform xml document in a manner which depends on above parameter list
There is a simple way to do this in Java. First I must parse the above doument into
org.w3c.dom.Element object, and then pass this object as a 'value' parameter in method
setParameter( String name, Object value)
of class
javax.xml.transform.Transformer.
And my problem is how to do it using Xalan C++. I _must_ do it in the same (or similar) way
as in java solution described above. I've found class XalanTransformer
(xalanc/XalanTransformer/XalanTransformer.hpp) has got only two instances of method
setStylesheetParam - first using constchar*, and second one using XalanDOMString& as
parameters. And that's all. I have found that XSLTEngineImpl object is used as XSLT processor
and it has a method defined below
XSLTEngineImpl::setStylesheetParam(
const XalanDOMString& key,
XObjectPtr value);
which prototype seems to look like it could be useful to resolve my problem. But I am not sure
this is the proper solution. Moreover, usage of this method requires XalanTransformer module
to be rewritten. But this method is called nowhere in Xalan source code, tests or examples, so
I have no idea how to convert (or assign, whatever) any object having part of XML document (for
example XalanElement*) to XObjectPtr and if it will work. Maybe there's another way of solving
my problem, which I can see now.
Can anybody help me? Thanks in advance,
My current version of Xalan is 1.8 and I haven't yet found any solution of my problem in Xalan
1.9 published today (22 Dec 2004)
--
Greetings
Jarek Lubczynski
There are 10 kinds of people:
Those who understand binary and those who don't
