Gentoo Archives: gentoo-doc

From: Xavier Neys <neysx@g.o>
To: gentoo-doc@l.g.o
Subject: Re: [gentoo-doc] GuideXML: define values & use conditional tags
Date: Fri, 28 Jul 2006 08:24:29
Message-Id: 44C9C960.6060307@gentoo.org
In Reply to: [gentoo-doc] GuideXML: define values & use conditional tags by Xavier Neys
1 Xavier Neys wrote:
2 Hi *,
3
4 Replying to the original post to keep links :)
5
6 > Please have a look at the following links and compare:
7 >
8 > Define values in books:
9 > http://gentoo.neysx.org/mystuff/handbook/handbook-mips.xml?passthru=1
10 > http://gentoo.neysx.org/mystuff/handbook/handbook-hppa.xml?passthru=1
11 > http://gentoo.neysx.org/mystuff/handbook/handbook-alpha.xml?passthru=1
12 > http://gentoo.neysx.org/mystuff/handbook/handbook-ppc64.xml?passthru=1
13 > http://gentoo.neysx.org/mystuff/handbook/handbook-ppc.xml?passthru=1
14 > http://gentoo.neysx.org/mystuff/handbook/handbook-amd64.xml?passthru=1
15 > http://gentoo.neysx.org/mystuff/handbook/handbook-sparc.xml?passthru=1
16 > http://gentoo.neysx.org/mystuff/handbook/handbook-x86.xml?passthru=1
17
18 Use them in shared chapters across all architectures:
19 > http://gentoo.neysx.org/mystuff/handbook/hb-install-config.xml?passthru=1
20
21 and in merged x86 & amd64 arch-specific chapters
22 http://gentoo.neysx.org/mystuff/handbook/hb-install-x86+amd64-bootloader.xml?passthru=1
23 http://gentoo.neysx.org/mystuff/handbook/hb-install-x86+amd64-disk.xml?passthru=1
24 http://gentoo.neysx.org/mystuff/handbook/hb-install-x86+amd64-kernel.xml?passthru=1
25 http://gentoo.neysx.org/mystuff/handbook/hb-install-x86+amd64-medium.xml?passthru=1
26
27 > I did not want to make block tags conditional to avoid having to test all
28 > p,table,pre,ul,dl... and added a test attribute to the body tag. The only
29 > change to the DTD would be to make "body+" and add the test attribute.
30 > The test can be any XPath expression that is evaluated and if it returns true,
31 > the body is processed.
32
33 Now, I do want more tags that allow a condition. I tried both ways and the XML
34 ends up a lot easier to read when you don't have to create bodies around a
35 single block tag.
36 Even <li> and <tr> can be made conditional.
37 Look at the table about the video statement in the bootloader section
38 http://gentoo.neysx.org/mystuff/handbook/handbook-x86.xml?part=1&chap=10
39 http://gentoo.neysx.org/mystuff/handbook/handbook-amd64.xml?part=1&chap=10
40 The only difference is an extra row. Using <tr test="...">... is a lot more
41 readable and easier to maintain than two separate tables inside different bodies.
42
43 > The result looks like:
44 > http://gentoo.neysx.org/mystuff/handbook/handbook-x86.xml?part=1&chap=8
45 > http://gentoo.neysx.org/mystuff/handbook/handbook-sparc.xml?part=1&chap=8
46 > http://gentoo.neysx.org/mystuff/handbook/handbook-amd64.xml?part=1&chap=8
47 > http://gentoo.neysx.org/mystuff/handbook/handbook-ppc.xml?part=1&chap=8
48 > http://gentoo.neysx.org/mystuff/handbook/handbook-ppc64.xml?part=1&chap=8
49 > http://gentoo.neysx.org/mystuff/handbook/handbook-alpha.xml?part=1&chap=8
50 > http://gentoo.neysx.org/mystuff/handbook/handbook-hppa.xml?part=1&chap=8
51 > http://gentoo.neysx.org/mystuff/handbook/handbook-mips.xml?part=1&chap=8
52
53 and for the merged x86 & amd64 bits:
54 http://gentoo.neysx.org/mystuff/handbook/handbook-x86.xml?part=1&chap=2
55 http://gentoo.neysx.org/mystuff/handbook/handbook-amd64.xml?part=1&chap=2
56 http://gentoo.neysx.org/mystuff/handbook/handbook-x86.xml?part=1&chap=4
57 http://gentoo.neysx.org/mystuff/handbook/handbook-amd64.xml?part=1&chap=4
58 http://gentoo.neysx.org/mystuff/handbook/handbook-x86.xml?part=1&chap=7
59 http://gentoo.neysx.org/mystuff/handbook/handbook-amd64.xml?part=1&chap=7
60 http://gentoo.neysx.org/mystuff/handbook/handbook-x86.xml?part=1&chap=10
61 http://gentoo.neysx.org/mystuff/handbook/handbook-amd64.xml?part=1&chap=10
62
63 I'll try to add it all on www.g.o early next week, or early the week after.
64 I receive family this weekend and I'll be away the next one, and I don't
65 commit anything like this unless I know I can be available in case anything
66 goes wrong :)
67
68
69 Cheers,
70 --
71 / Xavier Neys
72 \_ Gentoo Documentation Project
73 /
74 /\ http://www.gentoo.org/doc/en/

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies