Hi!

A new Xinclude approach is now available for review. It can be found into the 
installation sections of the kernel pages, boot in bootable and reboot 
chapters.

I will wait comments and complaints before to propagate it to the rest of the 
book.

That work as follow:

.- Each text block that will be included into other file(s) must have an 
os="some_string" attribute. "some_string" can be any string. 

That will allow us to know that some block is included to other file(s) when 
it will need to be edited or removed. 

I chosse the "os" attribute because is the most short one, don't have an 
special use in the stylesheets, and can be defined as an acronym for "Outside 
Sourced."

Example 1:

==chapter/common/package.xml==
<sect1>
    <para os="abc">Block to be included into other file.</para>
        
    <para>Block not included anywhere.</para>

    <para os="123">Another block to be included into other file.</para>
</sect1>
====

.- The "xpointer" attribute of the "xi:include" tag match the exact block that 
have the defined string value in the "os" attribute, regardless where is 
placed the requested block into the target file, making the Xinclude stuff 
possition-independant.

Example 2:

==chapter/arch/package.xml==
<sect1>
    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude";
    href="../common/package.xml"
    xpointer="xpointer(//[EMAIL PROTECTED]'abc'])"/>
        
    <para>Block not included from/to anywhere.</para>

    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude";
    href="../common/package.xml"
    xpointer="xpointer(//[EMAIL PROTECTED]'123'])"/>
</sect1>
=====

.- The "os" attribute is propagated also. That meant that we can point to text 
that was also imported on the target file. This will allow us to keep each 
arch book more self-contained.

Example 3:

==other-chapter/arch/package.xml==
<sect1>
    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude";
    href="../../chapter/arch/package.xml"
    xpointer="xpointer(//[EMAIL PROTECTED]'abc'])"/>
        
    <para>Block not included from/to anywhere.</para>

    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude";
    href="../../chapter/arch/package.xml"
    xpointer="xpointer(//[EMAIL PROTECTED]'123'])"/>
</sect1>
=====

.- To make edition changes isn't hard. 

To add a new block or to remove a non-exported one in a file don't have impact 
on other files. 

If the removal (full block deletion) or no more inclusion (removing only the 
"os" attribute) of a previously exported block is required, "make validate" 
will say what other files must be fixed also (or you can to grep the files 
for the "os" string value). 

Lastly, if for example a change in the "arch" stuff implies that the "123" 
block can't be included anymore from "common" to "arch", will be enought 
fixing "chapter/arch/package.xml" (Example 2) and, if suitable, removing the 
"os" attribute from "chapter/common/package.xml" (Example 1), remaining 
"other-chapter/arch/package.xml" (Example 3) untouched.


-- 
Manuel Canales Esparcia
Usuario de LFS nÂș2886:       http://www.linuxfromscratch.org
LFS en castellano: http://www.escomposlinux.org/lfs-es http://www.lfs-es.com
TLDP-ES:                           http://es.tldp.org
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to