[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Base URI for result of transformation?
Hi Stefan, It is a bit confusing to set up graphics directories this way. You are correct that relative paths are taken relative to the document that contains the path reference. In the case of FO output, the XSL-FO processor is reading the FO file and resolving the paths in the src attribute of any fo:external-graphic files. So it is interpreting the paths as relative to the location of the FO file. > What you are saying is that it is relative to the current working > directory, > i.e. the one the processor was invoked from. Is that really the case ? > I find that rather surprising ! The current working directory is not considered. For example, you could process the test files from within the testdocs/tests directory and write the FO output one level up in testdocs, and the relative paths would still resolve since that is where the graphics directory resides. Likewise, you could process the test files from above in the testdocs directory and write the FO output to tests, and the paths would not resolve, because tests does not contain a graphics directory. That shows that the current working directory is not used. The testdocs setup assumes the FO output will be placed in testdocs, as specified by the Makefile. Bob Stayton Sagehill Enterprises DocBook Consulting firstname.lastname@example.org ----- Original Message ----- From: "Stefan Seefeld" <email@example.com> To: <firstname.lastname@example.org> Sent: Tuesday, August 08, 2006 3:47 AM Subject: Re: [docbook-apps] Base URI for result of transformation? > Hi Bob, > > thanks for your answer ! > > Bob Stayton wrote: >> Hi Stefan, >> I'm not sure I understand what you are asking for. 8^) >> >> I don't think the stylesheet can insert xml:base attributes for content >> modules, because the stylesheet doesn't know from which directory any >> given piece of XML in the document comes from. The parsing process >> takes place before the document is fed to the stylesheet, and it is the >> parsing process that assembles the complete XML document from modules. >> The great leap forward with XIncludes over system entities is that an >> XInclude processor will insert xml:base attributes during parsing to >> keep track of the source file locations. > > Note that I don't think the problem at hand has anything to do with > XInclude. > (Though I have to admit that I was confused when a similar question came > up > some months ago, then indeed in the context of XInclude processing.) > >> Nor can the stylesheet insert xml:base for the document as a whole, >> because the stylesheet doesn't know the path to the document. The XSLT >> processor does, but it doesn't provide that information to the >> stylesheet. > > Right. > >> Then the question is whether the stylesheet should pass through to the >> FO file any xml:base attributes that an XInclude processor added. If >> that is what you meant, then that's a possibility, but I'd have to see >> an example to understand how that would work. Currently if >> $keep.relative.image.uris is set to 0 then xml:base attributes from the >> XInclude processor are merged (resolved) by the stylesheet into the >> fileref path so they are all relative to the FO file, not the original >> XML module. >> >> I took a look at the testdocs directory, and it seems that an xml:base >> wouldn't help there anyway. For example, the >> testdocs/tests/figure.001.xml has a fileref="graphics/duck-small.eps", >> but there is no "graphics" directory under tests. > > That's exactly what I find so confusing. > >> Rather, these files >> are meant to be processed by the Makefile from above in the testdocs >> directory with a command that processes the path >> "tests/figure.001.xml". The graphics directory is under testdocs, so >> the relative path works there. > > I would have thought that relative paths have the same semantics as > relative URLs in html documents, i.e. they are to be interpreted relative > to the document containing them (thus my asking about xml:base). > > What you are saying is that it is relative to the current working > directory, > i.e. the one the processor was invoked from. Is that really the case ? > I find that rather surprising ! > > Thanks, > Stefan > > -- > > ...ich hab' noch einen Koffer in Berlin... > > --------------------------------------------------------------------- > To unsubscribe, e-mail: email@example.com > For additional commands, e-mail: firstname.lastname@example.org > > >