[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] WARNING: cannot add @xml:base to node set root element. Relative paths may not work.
http://www.saxonica.com/documentation/sourcedocs/controlling-parsing.htmlThe XInclude spec says that xml:base attributes must be relative to the closest ancestor xml:base. I'm pretty sure that is how Saxon 6 behaves. If Saxon9 is generating xml:base attributes always relative to the top level, then that is not what the XInclude spec says, nor what the DocBook stylesheet expects.
Bob Stayton Sagehill Enterprises firstname.lastname@example.org -------------------------------------------------- From: "Alexey Neyman" <email@example.com> Sent: Tuesday, May 14, 2013 10:25 AM To: <firstname.lastname@example.org> Cc: "Bob Stayton" <email@example.com>; "Lars Vogel" <firstname.lastname@example.org>Subject: Re: [docbook-apps] WARNING: cannot add @xml:base to node set root element. Relative paths may not work.
Hi Lars, Bob, Just one point: xsltproc does xml:base fixup on nodesets included throughXInclude, so inside the document there are xml:base elements added properly. However, Bob's point still stands: if the top-level document is in non-currentdirectory, it will break the external references. Speaking of Saxon, I am not sure if it does xml:base fixup properly on XIncluded modular documents from different directories. Originally, I was investigating a bug in libxml2 regarding xml:base fixup (pushed to master,will be in the next release), but I also tried Saxon. Here is a link to thethread on libxml2 mailing list (which has a small test case attached): https://mail.gnome.org/archives/xml/2013-April/msg00024.htmlIn brief, Saxon seems to emit xml:base relative to top-level document ratherthan to the most recent point of inclusion. DocBook stylesheets (at least,1.78.0 that I used) assume the location relative to the base of the including nodeset. xsltproc conforms to the expectations of DocBook stylesheets, and asfar as I understand, to the XInclude specification. Regards, Alexey. On Tuesday, May 14, 2013 09:01:37 am Bob Stayton wrote:Hi Lars, You should get that message only when two conditions are met: 1. You are processing a DocBook 5 document with the non-namespaced stylesheets. or You are single-step profiling by using profile-docbook.xsl (probably your case). and 2. You are using xsltproc (which lacks an extension function to get the name of the current directory).With either condition in (1), the document is preprocessed into an internalnodeset (a nodeset held in memory) before being processed by the stylesheets. The internal nodeset loses all contact with the filesystem where the files originated, so the preprocessing template tries to addrelative directory references into the internal nodeset by adding xml:baseattributes to preserve the relative locations. It uses an extension function to get the original base directory of the document, but xsltproc does not have a function to fetch that information, while Saxon and Xalan do.So if you use modular doc and the modules are in various directories, thatdirectory structure information gets lost in the internal subset. If your documents don't need such xml:base attributes, then it has no effect on your output. You can avoid it by either using Saxon, or by using two-step profiling. Bob Stayton Sagehill Enterprises email@example.com From: Lars Vogel Sent: Tuesday, May 14, 2013 7:13 AM To: DocBook Apps Subject: [docbook-apps] WARNING: cannot add @xml:base to node set root element. Relative paths may not work. Hello, since a while I get the following warning during the transformation with the docbook distribution:WARNING: cannot add @xml:base to node set root element. Relative paths maynot work.I'm not sure what triggers this warning, a Google search resulted in hintsabout Docbook V5.0 but I'm still using Docbook 4.5. I'm currently using the docbook-xsl-1.77.1 distribution and I think (but I'm not sure) that I have this warning since I upgraded from 1.76. The output looks ok to me, but this warning does not create a warm fussy feeling. ;-) Any hint how to get rid of this warning? Best regards, Lars