| From | Sent On | Attachments |
|---|---|---|
| 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: | Adding new element to docbook DTD | |
|---|---|---|
| From: | John Dyer (jdy...@opushealthcare.com) | |
| Date: | Mar 28, 2006 3:38:06 pm | |
| List: | org.oasis-open.lists.docbook | |
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:
<if condition="C1"> <para condition="C2"> conditions C1 and C2 are true </para> </if>
The desired behavior of this would be for the para to print only if conditions C1 AND C2 are true. I can get the desired behavior (almost) by doing this:
<para condition="C1"> <para condition="C2"> conditions C1 and C2 are true </para> </para>
...but this creates two paragraphs where I only want one and yields more whitespace than I want. Plus, I don't think this is even valid docbook.
I need this element to be available at almost any level. In other words, I might want to do something like this:
<book> ... <if condition="book_A"> <chapter condition="book_B"> ... </chapter> <chapter condition="book_C"> ... </chapter> </if> ... </book>
My plan is to create a custom DTD that defines the "if" element and references docbookx.dtd as an entity... something like this:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<!ENTITY % (_______________) "|if"> <--- I have no idea what should go in the blank on this line and the one below <!ELEMENT if (_______________)>
<!ENTITY % DocBookDTD PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "[1]http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"> %DocBookDTD;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
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?
Thank you, John
References
Visible links 1. http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd






.bin