This is the mail archive of the
docbook@lists.oasis-open.org
mailing list for the DocBook project.
Re: FAQ: XML solution for conditonal sections
Bob Stayton wrote:
> Indeed, this is a FAQ:
> http://www.dpawson.co.uk/docbook/styling/profiling.html
> It's called "profiling" in the FAQ, and it's done with
> XML attributes and a XSLT preprocessor stylesheet.
Thanks! I went for
http://docbook.sourceforge.net/projects/xsl/doc/tools/profiling.html
The way I read this I can use multiple attributes to implement orthogonal
criteria like "target=internal|public" and "profile=reference|annotation|rfc",
and I can use multiple values each single element's attribute. Is it recommended
to use attr="val1;val2" or better to define a "val1and2"? E.g. profile="full"
would be equivalent to "reference;annotation;rfc" and include all.
I take it that using
attr=profile val=rfc
is preferable to extending the DocBook common attributes.
I would also guess that per-element attributes allow for different kinds of
filtering strategies. For example
<section target="internal">
<title>Something Public</title>
<para target="public">
Some public content
</para>
</section>
can be considered
a) an error - contained elements should not contradict the parent's settings
b) an override - parent element defines a default, which can be overridden
(won't work for the "public" rendering as the <section> is lost)
c) a mistake in the design? Don't make them common attributes?
Any recommendations for this? I found
CVS docbook/xsl/tools/profile/profile.xsl
anything other examples I should look at? I'd expect that creating
inconsistent attributes in the XML will create a broken profiled
intermediate (e.g. title missing, empty para etc.), which will be
detected in the second stage processing, so for user convenience it
might be worth having consistency checking in the profiling stage?
> > The DocBook guide seems to lack a "Adding an attribute" example?
>
> See Example 5.1 in
> http://www.docbook.org/tdg/en/html/ch05.html#ch05-write
"The requested URL /tdg/en/html/docbook.css was not found on this server."
This example is different from
Example 5-1. Adding MethodName with a Customization Layer
http://www.oasis-open.org/docbook/documentation/reference/html/ch05.html#EX-ADDMETHODNAME
is it?
b.