Apply additional constraints

Constraints allow you to limit the elements or attributes that can be used in certain contexts. For example, you might want to prevent the use of refsyn and related elements in reference topics. If you don't need to use those elements, you can constrain to simplify the authoring experience for authors. Constraints enable you to use a subset of the structure allowed by the DITA standard in a given context; you cannot use constraints to enable use of structure that the DITA standard itself does not allow.

CAUTION:
Be very careful with this change. If you activate the constraints in CompanyDitabase.dtd after you already have content that references it, that content might becomes invalid if it uses elements that are no longer allowed due to the new constraints. You must either edit the content so that it is no longer invalid or you must edit it so that it no longer references CompanyDitabase.dtd. The former is obviously the recommended option. To avoid creating this situation, IXIASOFT strongly recommends making these decisions before you accumulate a large amount of content.
  1. Check out and open CustomerDitabase.dtd.
  2. Find the IXIASOFT Additional Constraints section:
    <!-- ================== IXIASOFT Additional Constraints ========== -->
    <!--                    Strict Paragraph prevents the use of dl, fig, 
                            lines, lq, note, object, ol, pre, simpletable, 
                            sl, table and ul inside a <p>              -->
    <!--
    <!ENTITY % strictPara-c-def  
      PUBLIC "-//IXIA//ELEMENTS IXIA DITA 1.2 Strict Paragraph Constraint//EN" 
      "strictParaConstraint.mod">
    %strictPara-c-def;
    -->
    <!--                    Strict Section prevents the insertion of text
                            directly inside a section                  -->
    <!--
    <!ENTITY % strictSection-c-def  
      PUBLIC "-//IXIA//ELEMENTS IXIA DITA 1.2 Strict Section Constraint//EN" 
      "strictSectionConstraint.mod">
    %strictSection-c-def;
    -->

    This section contains two entities, strictPara-c-def and strictSection-c-def. The first entity, as you can read in the comment, prohibits the use of certain elements within a <p> element that would normally be allowed. The second entity does the same for <section>. Both of these entities are commented out by default.

  3. If you want to activate either or both of these constraints, comment the appropriate entity back in.

    As you can see, these entities reference two files, strictParaConstraint.mod, and strictSectionConstraint.mod. These two files also live in REPOSITORY/system/dtd/ixia. Now that you are referencing them from CustomerDitabase.dtd, which does not live in the same folder as these two .mod file, you must change the system identifier paths to correctly point to the files:

  4. Add the additional path levels as shown:
    <!-- ================== IXIASOFT Additional Constraints ========== -->
    <!--                    Strict Paragraph prevents the use of dl, fig, 
                            lines, lq, note, object, ol, pre, simpletable, 
                            sl, table and ul inside a <p>              -->
    <!ENTITY % strictPara-c-def  
      PUBLIC "-//IXIA//ELEMENTS IXIA DITA 1.2 Strict Paragraph Constraint//EN" 
      "../ixia/strictParaConstraint.mod">
    %strictPara-c-def;
    <!--                    Strict Section prevents the insertion of text
                            directly inside a section                  -->
    <!ENTITY % strictSection-c-def  
      PUBLIC "-//IXIA//ELEMENTS IXIA DITA 1.2 Strict Section Constraint//EN" 
      "../ixia/strictSectionConstraint.mod">
    %strictSection-c-def;
  5. Scroll back in the file to find the following section, just above the Content Constraint Integration section:
    <!--                    Add the following domains if paragraph and 
                            section constraints are enabled
                               &para-constraints;
                               &section-constraints;
    -->
  6. Comment back in the constraint(s) that you enabled.
  7. Save, close, and check in CustomerDitabase.dtd.

If you find that you need to edit either of these constraints, IXIASOFT recommends that you create your own modules rather than edit strictParaConstraint.mod or strictSectionConstraint.mod. You can copy those two files to REPOSITORY/system/dtd/client, rename them, and edit them as needed. Then, in CustomerDitabase.dtd, use those modules as the definitions of the strictPara-c-def and strictSection-c-def entities. You can also follow this model to create additional constraints of your own.