Re: [docbook-apps] Problems with XInclude and images
In your ant build file, what process is being used to resolve the XIncludes? Is there a separate step that creates a temporary XML file with XIncludes resolved before the stylesheet is applied? If so, then you can examine the xml:base attributes in it to see if those are correct. If they are not correct, then the XInclude processor has a problem. If they are correct, then the stylesheet has a problem. Bob Stayton Sagehill Enterprises DocBook Consulting [EMAIL PROTECTED] - Original Message - From: Tino Schöllhorn [EMAIL PROTECTED] To: docbook-apps@lists.oasis-open.org Sent: Monday, October 15, 2007 9:43 AM Subject: [docbook-apps] Problems with XInclude and images 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [docbook-apps] Problems with XInclude and images
Actually, I missed the part in your message where you mentioned the keep.relative.image.uris parameter. If keep.relative.image.uris is set to 1, then each relative path is *not* altered to account for xml:base attributes. For FO output, that parameter should be set to zero, except under unusual circumstances. But with it set to 1, your fo error should indicate that first-steps is not in the graphics path at all. I'm a little confused by that error. Bob Stayton Sagehill Enterprises DocBook Consulting [EMAIL PROTECTED] - Original Message - From: Bob Stayton [EMAIL PROTECTED] To: docbook-apps@lists.oasis-open.org; Tino Schöllhorn [EMAIL PROTECTED] Sent: Tuesday, October 16, 2007 11:41 AM Subject: Re: [docbook-apps] Problems with XInclude and images In your ant build file, what process is being used to resolve the XIncludes? Is there a separate step that creates a temporary XML file with XIncludes resolved before the stylesheet is applied? If so, then you can examine the xml:base attributes in it to see if those are correct. If they are not correct, then the XInclude processor has a problem. If they are correct, then the stylesheet has a problem. Bob Stayton Sagehill Enterprises DocBook Consulting [EMAIL PROTECTED] - Original Message - From: Tino Schöllhorn [EMAIL PROTECTED] To: docbook-apps@lists.oasis-open.org Sent: Monday, October 15, 2007 9:43 AM Subject: [docbook-apps] Problems with XInclude and images 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] - 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]
Re: [docbook-apps] Problems with XInclude and images
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