Background image in XML ..Urgent !!

Discussion in 'XML' started by Manoj Nair, Apr 21, 2004.

  1. Manoj Nair

    Manoj Nair Guest

    I have a XSL file which has the following code for background image.
    <fo:table-body>
    <fo:table-row text-align="center">
    <fo:table-cell background-image="copy.gif"
    border-after-style="none" border-before-style="none"
    border-end-style="none" border-start-style="none" font-size="10pt"
    text-align="center" padding-start="3pt" padding-end="3pt"
    padding-before="3pt" padding-after="3pt" display-align="center"
    border-style="solid" border-width="1pt" border-color="white">

    I am running this in weblogic and during runtime the FOP parser always
    looks for copy.gif in the weblogic directory which is
    c:\bea\user_projects\mydomain. But I have the gif file in my web
    application directory c:\xxx\yyy\ where the *.XSD file resides. What
    should I set the URL to to tell the FOP parser to get the gif file
    from same directory as where the XSD resides ??

    Thanks
     
    Manoj Nair, Apr 21, 2004
    #1
    1. Advertising

  2. Manoj Nair

    Patrick Melo Guest

    (Manoj Nair) wrote in message news:<>...
    > What should I set the URL to to tell the FOP parser to get the gif
    > file from same directory as where the XSD resides ??


    1. Write an action to pass the path to the sitemap.
    [see http://www.db.informatik.uni-kassel.de/Help/xml/cocoon/userdocs/concepts/actions.html]

    Context context = ObjectModelHelper.getContext(objectModel);
    String path = context.getRealPath(request.getServletPath());
    java.io.File f = new java.io.File(path);
    if (!f.isDirectory())
    path = f.getParentFile().getAbsolutePath();
    sitemapParams.put("path", path);

    2. In the transform element of your sitemap add a parameter to pass
    the path to the xsl.
    <map:parameter name="path" value="{path}" />

    3. In your xsl, add a parameter to use the path in your xsl.
    <xsl:param name="path" select="''"/>

    background-image="url('{$path}/copy.gif')"

    Hope this helps,
    Patrick
     
    Patrick Melo, May 11, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Raydog
    Replies:
    3
    Views:
    22,257
    Raydog
    Apr 9, 2004
  2. Noozer
    Replies:
    5
    Views:
    52,401
  3. jc
    Replies:
    3
    Views:
    1,758
  4. jc
    Replies:
    1
    Views:
    1,385
    Neredbojias
    Mar 19, 2008
  5. Dj Frenzy
    Replies:
    3
    Views:
    326
    Robert
    Feb 10, 2004
Loading...

Share This Page