source: stylesheets/lfs-xsl/docbook-xsl-1.78.1/assembly/README@ c8e0d1d

Last change on this file since c8e0d1d was 15c7d39, checked in by Matthew Burgess <matthew@…>, 11 years ago

Update stylesheets to docbook-xsl-1.78.1.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10355 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 7.4 KB
Line 
1DocBook Assembly Stylesheets
2==============================
3bobs@sagehill.net
4
5This directory provides XSL stylesheets for working with
6DocBook assemblies. It is intended to enable working with
7<topic> and <assembly> elements, as defined in DocBook 5.1
8and later.
9
10This kit currently supports most features of an assembly.
11See the "Unsupported Features" section below for details
12of what is not currently supported. These more advanced
13features will be supported as it is further developed.
14
15
16Content of this directory:
17--------------------------
18topic-maker-chunk.xsl - stylesheet to modularize an existing DB5 document.
19topic-maker.xsl - imported by topic-maker-chunk.xsl.
20assemble.xsl - stylesheet to process an <assembly> into a document.
21
22
23The toolkit consists of an assemble.xsl XSL stylesheet
24to process a DocBook <assembly> element to convert it
25to an assembled DocBook 5 document ready to be formatted.
26This stylesheet will enable users to structure a book from
27modular files.
28
29To make it easy to initially create a modular book, this
30kit also includes a topic-maker-chunk.xsl XSL stylesheet
31to break apart an existing DocBook 5 book into modular
32files, and also create the associated <assembly> document.
33Then you can run the assemble.xsl stylesheet to put it
34back together as a single DocBook document.
35
36
37To create an assembly and topic files from a book or article document
38=======================================================================
39
40If you have an existing DocBook 5 book or article document,
41you can convert it to an assembly and a collection of
42modular topic files. If you want to convert a DocBook 4
43document, you must first convert it to version 5.
44
45For example, to disassemble a DocBook 5 book document named book.xml:
46
47xsltproc --xinclude \
48 --stringparam assembly.filename myassembly.xml \
49 --stringparam base.dir topics/ \
50 topic-maker-chunk.xsl \
51 mybook.xml
52
53This command will result in a master assembly file named
54'myassembly.xml' with a root element of <assembly>, containing
55a single <structure> element. It will also break up the
56content of the book into modular chunks that are output
57to the 'topics/' subdirectory as specified in the 'base.dir'
58parameter.
59
60Options
61----------
62The name of the assembly file is set by the stylesheet param
63named 'assembly.filename', which should include the filename suffix.
64
65Modular files are output to the directory location specified
66by the 'base.dir' parameter. If you want them in the current
67directory, then don't set that param.
68
69By default the assembly element is output to the current
70directory, *not* into base.dir with the modular files.
71The <resources> element in the assembly has its xml:base
72attribute set to the value of 'base.dir', so that it is
73added to the paths to the modular files when processed.
74If you set the stylesheet param 'manifest.in.base.dir'
75to 1, then the assembly file is created in the base.dir
76directory and the xml:base attribute is omitted (since
77they are together in the same directory).
78
79If you want the assembly file in 'base.dir' instead of
80the current directory, then set the stylesheet param
81'manifest.in.base.dir' to 1.
82
83The stylesheet chunks a document into modules at the
84same boundaries as the chunking XHTML stylesheet, because
85it reuses many of the chunking stylesheet templates.
86You can alter the chunking behavior with the same options
87as for XHTML chunking.
88
89For example, the stylesheet will chunk sections into topics
90down to section level 3 by default. To change that level,
91change the stylesheet param 'chunk.section.depth' to
92another value.
93
94Finer control of chunking can be achieved by using
95the <?dbhtml stop-chunking?> processing instruction in
96the source file.
97
98Many modular elements retain their original element name,
99such as glossary, bibliography, index, and such. By default, the
100stylesheet converts chapter, article, preface and section elements
101into <topic> modules. To change that list of
102converted element names, alter the stylesheet param named
103'topic.elements'. If that param is empty, then no elements
104will be converted to <topic>, so they will all retain their
105original element names.
106
107Modular filenames use the same naming scheme as the chunking
108XHTML stylesheet, and supports the same file naming options such as
109the param 'use.id.as.filename', which is set to 1 by default.
110Note that the stylesheet param 'html.ext' is set to '.xml'
111because it is producing modular XML files, not HTML files.
112
113Root element conversion
114------------------------
115By default, the root element of the original document is
116also converted to a module, and <structure> gets a resourceref
117attribute to reference it. If you set the stylesheet
118param 'root.as.resourceref' to zero, then the root element
119is handled differently, as described as follows.
120
121If the structure element does not have a resourcref
122attribute, the root element is constructed rather
123than copied from a resource. The structure element must
124have a renderas attribute (or its child output element must
125have such) to select the output root element name.
126
127Any content between the root element start tag and the
128first module is put into a resource with the original
129root element. To pull this content in, the first
130module in the structure points to this resource but
131uses a contentonly="yes" attribute. The effect of
132that attribute is to pull in all content *except*
133the root element of that resource.
134
135In general, if you have content that does not logically
136have its own container element, you can put the content
137into a suitable container element and then deselect the
138container element upon assembly with the contentonly="yes"
139attribute. That attribute can also be used to avoid
140pulling in a resource's xml:id when you want to change it.
141
142
143To process an <assembly> into an assembled DocBook document
144==============================================================
145
146To convert an <assembly> and its associated modular
147files into a single DocBook document, process
148your assembly document with the assemble.xsl stylesheet.
149You should then be able to process the resulting
150document with a DocBook XSL formatting stylesheet.
151
152
153
154
155Useful params in assemble.xsl
156-----------------------------
157The $root.default.renderas param sets the name of the
158root element of the assembled document, if it is not
159otherwise specified with @renderas. Its default value
160is 'book'.
161
162The $topic.default.renderas param sets the name of the
163output element for any topic element included in the
164assembly, if it is not otherwise specified with
165@renderas. It's default value is 'section'.
166
167The $structure.id param lets you specify at runtime
168the id value of the structure you want to reassemble.
169This is only necessary if you have more than one
170structure element in your assembly.
171
172The $output.type param also lets you specify at runtime
173which structure element to process. In this case,
174the value should match on an @type attribute on
175the structure element.
176
177The $output.format param lets you specify at runtime
178which of several possible output formats are being generated.
179The param value is compared to the @format
180attribute on <output> elements to select specific properties
181for a module.
182
183
184
185Unsupported Features
186-----------------------
187
188The transforms and transform elements are currently ignored
189by the assembly stylesheet.
190
191The relationships and relationship elements are currently
192ignored by the assembly stylesheet.
193
194The filterin and filterout elements are not currently
195supported.
Note: See TracBrowser for help on using the repository browser.