Hi Tino
This sounds a bit like the xml:base problem I had a couple of years ago. See the mail below and the pre-processing xsl step to remove duplicate directory names.
Ron

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
    <!-- default copy template, plus passing over a base parameter -->
    <xsl:template match="node() | @*">
        <xsl:param name="base" select="''"/>
        <xsl:copy>
            <xsl:apply-templates select="node() | @*">
                <xsl:with-param name="base" select="$base"/>
            </xsl:apply-templates>
        </xsl:copy>
    </xsl:template>
    <!-- handle elements containing xml:base -->
    <xsl:template match="[EMAIL PROTECTED]:base]">
        <xsl:param name="base" select="''"/>
        <xsl:copy>
            <xsl:apply-templates select="@*[not(self::xml:base)]"/>
            <xsl:attribute name="xml:base">
                <xsl:choose>
<xsl:when test="$base='' or not(contains(@xml:base, $base))">
                        <xsl:value-of select="@xml:base"/>
                    </xsl:when>
                    <xsl:otherwise>
<xsl:value-of select="substring-after(@xml:base, $base)"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:attribute>
            <xsl:apply-templates select="node()">
                <xsl:with-param name="base">
                    <xsl:call-template name="getBase">
                        <xsl:with-param name="base" select="@xml:base"/>
                    </xsl:call-template>
                </xsl:with-param>
            </xsl:apply-templates>
        </xsl:copy>
    </xsl:template>
    <!-- extracts the folder from an xml:base value -->
    <xsl:template name="getBase">
        <xsl:param name="base" select="''"/>
        <xsl:if test="contains($base, '/')">
            <xsl:value-of select="substring-before($base, '/')"/>
            <xsl:text>/</xsl:text>
            <xsl:call-template name="getBase">
<xsl:with-param name="base" select="substring-after($base, '/')"/>
            </xsl:call-template>
        </xsl:if>
    </xsl:template>
</xsl:stylesheet>

Date: Tue, 20 Sep 2005 10:53:53 +0300
From: Oxygen XML Editor support <[EMAIL PROTECTED]>
X-Accept-Language: en-us, en
To: Ron Catterall <[EMAIL PROTECTED]>
Subject: [Fwd: Re: Sorin: Fwd: Re: problems with docbook xsl and the docbook-apps
  mailing list]

Return-Path: <[EMAIL PROTECTED]>
X-Original-To: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
Received: from [10.0.0.23] (unknown [10.0.0.23])
        by decebal.sync.ro (Postfix) with ESMTP id ED261604E4;
        Fri, 16 Sep 2005 15:29:19 +0300 (EEST)
Message-ID: <[EMAIL PROTECTED]>
Date: Fri, 16 Sep 2005 15:36:11 +0300
From: Oxygen XML Editor support <[EMAIL PROTECTED]>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Ron Catterall <[EMAIL PROTECTED]>
Cc: Bob Stayton <[EMAIL PROTECTED]>
Subject: Re: Sorin:  Fwd: Re: problems with docbook xsl and the docbook-apps
  mailing list
References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
In-Reply-To: <[EMAIL PROTECTED]>
Content-Type: multipart/mixed;
 boundary="------------090701090606070705070002"

Hi Ron,

Please find attached the stylesheet that does the xml:base fixup. Basically it copies the document and does a special handling of the xml:base, that is if the current xml:base starts with the directory specified by the previous xml:base then it removes that directory from the current xml:base.
What you need to do is:

1. Use the Configure Transformation Scenario action to open the transformation scenarios dialog
2. Choose your DocBook to HTML scenario
3. Use the duplicate button to create a copy of that
4. Copy to clipboard the current value for XSL URL
5. Use the Additional XSLT stylesheets button to show the additional XSLT stylesheets dialog
6. Choose Add and paste the URL you copied earlier
7. Choose Ok to close the additional XSLT stylesheets dialog
8. Edit the XSL URL field to point to the fixXMLBase.xsl stylesheet
9. Choose Ok to close the dialog
10. Use this scenario to transform DocBook to HTML

We tried this with your samples and it works ok.

I copied also Bob in case he finds this stylesheet useful for other people using XInclude and Xerces.

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
Hi,

we are setting up docbook for documenting our project. So far everythings goes well. There is just on issue with which I am struggling: When using images in document parts which are included by "XInclude" the XSLT-Stylesheet seems to apply the xml:base twice!

The project is layouted like this:

main.xml
|--------first-steps
|               |-------pictures
|               |-------first-steps.xml

(and so on)

The picture should be stored in first-steps/pictures. When writing the document "first-steps.xml" we use the following docbook part to include an image:

<graphic fileref="pictures/login.jpg"/>

Which works nicely - as long we don't XInclude the first-steps.xml in the main.xml

As I understand one should set the XSLT-Option "keep.relative.image.uris" to "1" so that the xml:base values are applied. When doing so, we get HTML output which is like:

<img src=first-steps/first-steps/pictures/login.jpg>

When transforming to PDF output an error occurs that the picture "first-steps/first-steps/pictures/login.jpg" cannot be found.

Obviously the xml:base attribute has been applied twice.

So, what am I missing here? Is there a general error?

I am using docbook-xsl-1.73.2 and Ant 1.7 to generate the documents.

Does someone has an idea what is missing?

In hope for an hint
Tino


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


--
Ron Catterall, Phd, DSc                         email: [EMAIL PROTECTED]
Prolongacion de Hidalgo 140                             http://catterall.net/
San Felipe del Agua                                     tel: +52 951 520 1821
Oaxaca      68020       Mexico                          fax: +1 530 348 8309

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

Reply via email to