Hello,

Thank you for the reply.  Unfortunately I want to modify the servlet in such
a way so that it can load the xml file from another server via http.  I am
not sure if this will require modification to the underlying xslt
tranformation libraries or what.  Unfortuneately i'm not a java programmer
so i'm not sure where to start.  I can see  this being a requirement of
other people who use this in a servlet so i was hoping that someone has
already done such a modification and could share it.  I haven't been able to
find this tho on this list or the dev list.  right now i'm crossing my eyes
at java docs seeing if i can figure anything out but i'm sure someone else
has done this and it was relatively easy.

-Adam

-----Original Message-----
From: Jasmin Mehta [mailto:[EMAIL PROTECTED]
Sent: March 21, 2003 10:31 AM
To: [EMAIL PROTECTED]
Subject: RE: url to xml/xsl file in servlet


Hi,

For example your application context path is

$web_app$/MyApplication

and you want to give url for the image folder inside it,

like http://localhost/MyApplication/image

than in your servlet where you write FOP code, you need to write below
code:

String real_path = file:"+getServletContext().getRealPath("/image");
org.apache.fop.configuration.Configuration.put("baseDir",real_path);

This will set the base dir for your url which you can use for your
relative path.

For example you want to give url for the image

$web_app$/MyApplication/image/mypic.jpg

than your xsl-fo file will have below code

<fo:block text-align="center" line-height="40pt" start-indent =
"10.0cm">
        <fo:external-graphic height="auto" width="auto"
content-height="auto" content-width="auto">
         <xsl:attribute name="src">url('mypic.jpg')</xsl:attribute>
</fo:external-graphic>
</fo:block>

Hope this will work.

Jasmin

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to