This is the mail archive of the docbook@lists.oasis-open.org mailing list for the DocBook project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[docbook] Re: A complex case of profiling


On Wed, Apr 27, 2005 at 04:49:53PM +0200,
 Stephane Bortzmeyer <bortzmeyer@nic.fr> wrote 
 a message of 33 lines which said:

> I have several binary (have / have not) conditions, which do not fit
> in predefined attributes like "os" or "userlevel", so I use the
> generic "condition" attribute.

OK, I was not aware of the ";" separator in the style sheet. I know
have a working solution. Thanks to everyone, especially Jirka Kosek
and Ruth Ivimey-Cook.

Here is a sample file:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
     "http://docbook.org/xml/4.3/docbookx.dtd";>
<article lang="en">
  <abstract>
  <para>This document describes the API of the CODEV-NIC system</para>
  </abstract>
  <section><title>Modules</title>
  <para>We have <phrase
  condition="have_registrars">four</phrase><phrase
  condition="no_have_registrars">three</phrase> important modules:
  domains, contacts<phrase condition="have_registrars">,
  registrars</phrase> and hosts.</para>
  </section>
  <section><title>Syntax</title>
   <para>Domain names have syntactic restrictions. For instance, spaces
are never authorized.
<phrase condition="idn">Legal domain names are those authorized by
RFC 3490, practically all the Unicode character
repertoire.</phrase>
<phrase condition="no_idn">Legal domain names are composed of US-ASCII
letters, digits and the hyphen character because of RFC
1123. Domains names starting with "xn--" are not allowed.
</phrase>
</para>
</section>
</article>

And here is a (part of) Makefile to create the profiled version. The
actual list of conditions is created by hand (be careful not to forget
one or you will lose everything related, wether it is prefixed by no_
or not):

%.profiled.db: %.db
	#TODO: generate the conditions from the config file. Add to Config?
	xsltproc --output $@ \
		--stringparam profile.condition "no_have_registrars;idn" \
		${PROFILE}  \
		$<
 

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-help@lists.oasis-open.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]