|John Dyer||Mar 28, 2006 3:38 pm|
|Thomas Schraitle||Mar 29, 2006 8:45 am|
|John Dyer||Mar 29, 2006 9:17 am|
|Jirka Kosek||Mar 29, 2006 9:48 am||.bin|
|Bob Stayton||Mar 29, 2006 10:04 am|
|Dick Hamilton||Mar 29, 2006 10:06 am|
|John Dyer||Mar 30, 2006 9:58 am|
|Chris Chiasson||Mar 30, 2006 11:19 am|
|Jirka Kosek||Mar 30, 2006 12:27 pm||.bin|
|Bob Stayton||Mar 30, 2006 11:48 pm|
|Subject:||RE: [docbook] Adding new element to docbook DTD|
|From:||Dick Hamilton (rlha...@frii.com)|
|Date:||Mar 29, 2006 10:06:33 am|
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.
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:jdy...@opushealthcare.com] Sent: Wednesday, March 29, 2006 10:20 AM To: docb...@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.
-----Original Message----- From: tom_...@web.de [mailto:tom_...@web.de] Sent: Wednesday, March 29, 2006 10:48 AM To: docb...@lists.oasis-open.org Subject: Re: [docbook] Adding new element to docbook DTD
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  and .
rofiling.h tml  http://www.sagehill.net/docbookxsl/Profiling.html
-- Thomas Schraitle