OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RE: [docbook] Adding new element to docbook DTD


John,

What I'd be inclined to do in this case is to define a new
condition, C3, which is true when C1 and C2 are true, then
use that condition on a single para.  I presume you're calling
your xsl processor with profile.condition set to "C1;C2",
so you'd just use "C1;C2;C3" instead and put condition="C3"
on your para.  Unless you've got a boatload of conditions
and combinations, this should be reasonably clean and doesn't
require any customization.

Another choice would be to make your inner nested para a phrase.
Since phrase shouldn't generate any line breaks, etc., you won't
get the spurious output.  But, if C1 is set and C2 isn't, you'll
get an empty para, which you probably don't want.  Also, you
can't nest any block elements inside the phrase, which may or
may not be a problem.

Dick Hamilton

P.S.  I just noticed Jirka's response, which is yet another
      way of approaching this problem.  Overall, I think you'll
      find there are several ways of looking at this that don't
      require customization.

> -----Original Message-----
> From: John Dyer [mailto:jdyer@opushealthcare.com] 
> Sent: Wednesday, March 29, 2006 10:20 AM
> To: docbook@lists.oasis-open.org
> Subject: RE: [docbook] Adding new element to docbook DTD
> 
> 
> Tom, 
> Thanks for the info, but I am actually already using profiling.  The
> problem I have is that I need to select parts of my document to print
> based on multiple profile conditions.  The only logical 
> operator docbook
> supports is OR.  Let's say we have two possible conditions (profiles),
> C1 and C2, and this example appears in my book:
> 
> <para condition="C1;C2">
> 	this is a test
> </para>
> 
> This paragraph would be printed if C1 is true OR C2 is true.  I would
> like to have a way to print this paragraph only if C1 is true 
> AND C2 is
> true.  As far as I can tell, docbook does not support this, so my idea
> is to nest elements with the conditions that need to all be 
> true.  Take
> this example:
> 
> <para condition="C1">
> 	<para condition="C2">
> 		this is a test
> 	</para>
> </para>
> 
> This actually produces the desired result in terms of printing only if
> C1 AND C2 are true, but it produces 2 paragraphs.  In other 
> words, there
> is an extra blank line before the text, which is not desirable.
> 
> Hopefully that makes a bit more sense.
> 
> Thanks,
> John
> 
> 
> 
> -----Original Message-----
> From: tom_schr@web.de [mailto:tom_schr@web.de] 
> Sent: Wednesday, March 29, 2006 10:48 AM
> To: docbook@lists.oasis-open.org
> Subject: Re: [docbook] Adding new element to docbook DTD
> 
> Hi John,
> 
> On Wednesday 29 March 2006 01:40, John Dyer wrote:
> > Hi, I would like to add a new element to docbook to allow for more 
> > control over conditional processing.  Here is an example of what I 
> > would like to do:
> >
> > [...]
> > Am I on the right track here?  Is this even possible?  If 
> there is a 
> > better way, I would like to hear about it.  If this is a possible 
> > solution, could someone help me fill in the blanks above?
> 
> After reading your mail it seems that your problem is better 
> solved with
> profiling. It's invented for conditional text/processing. The big
> advantage is that you don't have to customize the DocBook DTD.
> 
> It's pretty simple, you just have to add attributes with appropriate
> values. Another big advantage is that is already pretty well supported
> by the DocBook stylesheets. For more information see [1] and [2].
> 
> 
> Tom
> 
> ------
> [1]
> http://docbook.sourceforge.net/release/xsl/current/doc/tools/p
rofiling.h
tml
[2] http://www.sagehill.net/docbookxsl/Profiling.html

--
Thomas Schraitle

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


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





[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]