On Mon, Feb 16, 2009 at 23:44, Laurent Laville <p...@laurent-laville.org> wrote:
> Hello Hannes,
>
> While I've investigated a little in partial rendering features, I found a
> curious syntax.
>
> Perharps you could explain me where does it came from (or if it's just a
> typo error somewhere)
[..]
>
> Could you explain why in docbook file name (-d), we must have a dot as
> prefix name. Whitout this no render are available !

I guess the peardoc configure.php could be slightly more verbose on
what exactly it is doing.

The '.manual.xml' is one giant file, containing all other XML files
"magically linked" from 'manual.xml'.
What configure.php does it to resolve all entities (recursively) from
'manual.xml' and build a one giant XML file. That file is then saved
as '.manual.xml' and PhD uses that file to render.

The reason why PhD wants to use the "giant version" (.manual.xml) is
because parsing one giant file (rather then resolving the entities
on-the-fly) is at least 20% faster then parsing 'manual.xml'.
Furthermore, since configure.php needs to resolve all the entities to
be able to validate the XML (and against DocBook) you get this 20%
performance boost for free. Other things configure.php does is to
expand XIncludes, which PhD would have to resolve otherwise and it
does minor compact node optimization.

Sure, PhD could add the XMLReader::SUBST_ENTITIES parser flag (and
other things configure.php does) so it would be capable of parsing
'manual.xml', but that will reduce performance and increase memory
usage (quite significantly)...

Admittedly, I haven't benchmarked enabling the flag on a file without
entities (i.e. '.manual.xml') so there very well could be no
performance loss..
But thats the reason behind .manual.xml - configure.php already does
the entity resolving and XInclude work and there is no need to do it
again :)

-Hannes

Reply via email to