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: Adding new element to docbook DTD


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" "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


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