I got a mental block on this. Of course the
javax.xml.transform.Transformer object, which is used to run the
transformation has the method:
public abstract void setParameter(java.lang.String parmName,
java.lang.Object value);
which you use rather than -param from the command line as I previously
suggested.
Xalan-J will support java.lang.String type for the value (which is all you
really need). I don't know how you go about calling such a method on the
Transformer object which is buried inside of the servlet (to which you say
you don't have the source code).
You could get your hooks in there somehow. Define your own
TransformerFactory (that extends Xalan-J's factory) etc etc. The object
held by the servlet is now a Transformer of a slightly different type, and
maybe, just maybe you can figure out how to call setParameter on you super
class. It sort of hurts my stomach to suggest this sort of thing.
- Brian
mountainbiker
<mailing.list.tra
[EMAIL PROTECTED]> To
[email protected]
05/07/2008 03:13 cc
PM
Subject
Re: Need Xalan-J Java Extension to
Get URL
Brian thank you for taking the time to respond.
The transformation servlet--was based initially on the servlet
samples/examples provided with Xalan-J--will accept parameters via the URL,
so I am not tied to the command-line method (which I use in XMLSpy).
Currently, I do pass in this additional parameter, but it is annoying as
the
information is already present in the complete URL.
Time permitting I will probably have to write a small class to extend
javax.servlet.
All the best.
Brian Minchau wrote:
>
>
> If you were running from the command line you could run this class:
>
> org.apache.xalan.xslt.Process
>
>
>
>
> One of the possible options is -param, for example:
> -param myParam myValue
> (see http://xml.apache.org/xalan-j/commandline.html )
>
> Then in your stylesheet:
> <xsl:param name="myParam"/>
> ...
> <xsl:value-of select="$myParam"/>
> ...
>
> I'm not sure how to set parameters when invoked via a servlet, and for
> which you don't have the code.
>
> - Brian
>
>
>
>
> mountainbiker
> <mailing.list.tra
> [EMAIL PROTECTED]>
To
> [email protected]
> 05/07/2008 01:53
cc
> AM
>
Subject
> Need Xalan-J Java Extension to Get
> URL
>
>
>
>
>
>
>
>
>
>
>
> I am running a servlet under Tomcat. The servlet is a "wrapper" for
> Xalan-J
> that transforms a given XML/XSL combo. (I don't have access to this
> servlet
> source code.)
>
> I have been successful in getting super basic Java calls working in my
> XSLs
> (such as string.toUpperCase or InetAddress.getLocalName).
>
> My current requirement is for my XSLT to be able to know the complete URL
> of
> what called it. For example, I want something like
> http://server1.abc.com/trans?xml=...&xsl=... or
> http://server2.abc.com/trans?xml=...&xsl=... that I can store into a
> variable.
>
> The IP address and box name I can get via InetAddress. It is the URL
that
> I
> really need.
> --
> View this message in context:
>
http://www.nabble.com/Need-Xalan-J-Java-Extension-to-Get-URL-tp17097858p17097858.html
>
> Sent from the Xalan - J - Users mailing list archive at Nabble.com.
>
>
>
>
>
>
--
View this message in context:
http://www.nabble.com/Need-Xalan-J-Java-Extension-to-Get-URL-tp17097858p17112406.html
Sent from the Xalan - J - Users mailing list archive at Nabble.com.
<<inline: graycol.gif>>
<<inline: pic27707.gif>>
<<inline: ecblank.gif>>
