OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] FW: [[1454121] Path dirs repeated twice in imagedataurls]


Hi Michael,

We provided then to Ron also a workaround. I added that below in case 
that helps. The stylesheet that is referred as attached is in-lined below.

***
-------- Original Message --------
Subject: Re: Sorin:  Fwd: Re: problems with docbook xsl and the 
docbook-apps  mailing list
Date: Fri, 16 Sep 2005 15:36:11 +0300
From: Oxygen XML Editor support <support@oxygenxml.com>
To: Ron Catterall
CC: Bob Stayton

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
***

The stylesheet fix XMLBase.xsl:


<?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="*[@xml: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>

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Michael(tm) Smith wrote:
> Ron Catterall <ron@catterall.net> writes:
> 
>> This looks like the problem in Xerces reported last September - see below
> 
> Thanks -- looks like the following is the page for bug Sorin filed
> 
>   http://issues.apache.org/jira/browse/XERCESJ-1102
> 
> But seems there's not been any action at all taken on it since he
> reported it. Looks like it'll be a while before it's fixed.
> 
>   --Mike
> 
>> Date: Fri, 16 Sep 2005 12:08:33 +0300
>> From: Oxygen XML Editor support <support@oxygenxml.com>
>> X-Accept-Language: en-us, en
>> To: Bob Stayton <bobs@sagehill.net>
>> Cc: Ron Catterall <ron@catterall.net>
>> Subject: Re: Sorin: problems with xml:base in docbook xsl
>>
>> Hello,
>>
>> You are right, the XInclude processor does not generate the correct 
>> xml:base attributes. We will file a bug report on the Xerces parser 
>> bugzilla.
>>
>>
>> Thank you,
>> Sorin


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]