docbook-apps

  • 1.  Replacing Terms

    Posted 05-02-2007 15:43
    I understand the concept in DocBook of profiling, or conditional text. In a
    particular situation, I have a case where we need to produce custom
    documentation from a core version, the custom documentation only differing
    by the fact that certain terms are called something else (essentially, just
    a global find and replace).

    Rather than using the phrase element as recommended in the section on
    "Marking small bits of text", as described in
    http://www.sagehill.net/docbookxsl/MarkTextBits.html, I was wondering if
    anyone else had ever instead done some kind of processing step before
    running Saxon?

    Regards,

    -pm

    http://oceanclub.blogspot.com

    "I can win an argument on any topic, against any opponent.
    People know this, and steer clear of me at parties. Often, as a
    sign of their great respect, they don't even invite me."





  • 2.  RE: [docbook-apps] Replacing Terms

    Posted 05-02-2007 17:48
    Paul,

    This is one way that I handle it (taken from Stayton's book)

    I use ENTITY statements. Our product is currently named EDGE. However,
    in a few months it will be renamed. So what I do is have an include file
    with ENTITY statements in it. The entry for the NAME of EDGE would be:


    This is in a file (eec-edge-defs.mod) that is included in every source
    file:

    "http://www.docbook.org/xml/4.4/docbookx.dtd"[

    %edge-defs;
    ]>

    Then every place where the word "EDGE" is referenced, I replace it with
    "&EDGE;". So in your case, you will only have to do the search and
    replace operation once.

    Now when the name is changed in a few months I just change one file and
    everything changes. Its kind of like a "#define" in the C/C++ language.


    Hope this helps.

    Dean Nelson
    Enterprise Electronics Corp