[RFC] <group> element for DTD to support XInclude files

Kevin P. Fleming kpfleming at linuxfromscratch.org
Sun Mar 7 13:08:20 PST 2004

Dermot Bradley wrote:

> So with these changes in mind how should I rewrite my profiles?

Keep in mind that some of these changes are only present in the DTD, I 
haven't written the code for them yet (specifically <packagegroup>). In 
addition, there are some problems with nALFS-CVS at the moment, but they 
should be fixed in the next 24 hours.

> File base/lfs/lfs.xml:

OK, you've got two layers of xi:include just to get to this level. I'm 
not sure if there's a better way to do this XML-wise, but if there's not 
I'll need to change the DTD back to continue to allow <alfs> inside <alfs>.

> <!DOCTYPE alfs SYSTEM "../../ALFS.dtd" [
> <!ENTITY % general-entities SYSTEM "../entities/general">
> %general-entities;
> ]>
> <alfs syntax="3.1" xmlns:xi="http://www.w3.org/2001/XInclude">
> <stage name="LFS part 1">
>    <xi:include href="unpack-tarball.xml"/>
>    <xi:include href="chown.xml"/>
>    ...
>    ...
>    <xi:include href="glibc.xml"/>
> </stage>
> </alfs>
> File base/lfs/glibc.xml:
> <!DOCTYPE alfs SYSTEM "../../ALFS.dtd" [
> <!ENTITY % general-entities SYSTEM "../entities/general">
> %general-entities;
> ]>
> <alfs syntax="3.1" xmlns:xi="http://www.w3.org/2001/XInclude">

This is not necessary, unless you are using xi:include _inside_ this file.

> <stage name="Glibc">
> <stageinfo>
>    <root>&LFS;</root>
> </stageinfo>

I would follow the lead of the "official" profile here (wrapping a 
single stage around the packages), and put this <stage> element in 
base/lfs/lfs.xml, with all the other xi:include elements inside it. This 
will perform better as well, since nALFS will only have fork()/chroot() 
one time instead of once for each package.

However, it means that the DTD needs to support xi:include inside 
<stage> and <packagegroup> as well.

> <package name="glibc" version="&glibc-version;">
>    <stage name="Unpacking Glibc">
> ...
> ...
> </package>

This would be the only content in this file, except for the xml version 
header and the DOCTYPE element.

These are just my recommendations of course, anything that validates and 
runs the way you expect is certainly OK. There is the additional problem 
that DTD validation does not support XML Namespaces very well (see 
recent discussion on lfs-dev), so we may be fighting a losing battle 
trying to get a DTD constructed that covers all the needs we have. If 
someone out there has time to look in RelaxNG and other forms of XML 
validation, it would be nice if we could come up with a better way of 
doing this.

More information about the alfs-discuss mailing list