docbook-apps

  • 1.  Alternatives to entities for referencing small substitutions

    Posted 10-18-2016 10:08
    Hello,

    I’ve been out of the DocBook ecosystem for a few years, but I’ve got some documentation to write and I’m rolling up my sleeves! I would have thought the following would be a FAQ, but Dave Pawson’s page is giving me a 404 right now.

    What is the state of the art for small text substitutions (basically just domain-specific terms) that can also be varied via the profiling machinery? I have an application that can run as more than one “product”, and each product shows domain-specific variations in labels, for example, in the user interface. There might be a generic term for some object “Foo”, but Application A will call this a “Bar”, and Application B calls it a “Baz”. What I want to be able to do is refer to a “Foo” throughout the source, but substitute “Bar” for App A’s output, and “Baz” for App B’s. What’s the best way to achieve this?


    --
    Paul Hoadley
    http://logicsquad.net/






  • 2.  Re: [docbook-apps] Alternatives to entities for referencing small substitutions

    Posted 10-18-2016 11:41
    Paul, I now defer to Bob at
    http://www.sagehill.net/docbookxsl/ which is a most excellent resource.

    HTH

    On 18 October 2016 at 11:08, Paul Hoadley <paulh@logicsquad.net> wrote:
    > Hello,
    >
    > I’ve been out of the DocBook ecosystem for a few years, but I’ve got some
    > documentation to write and I’m rolling up my sleeves! I would have thought
    > the following would be a FAQ, but Dave Pawson’s page is giving me a 404
    > right now.
    >
    > What is the state of the art for small text substitutions (basically just
    > domain-specific terms) that can also be varied via the profiling machinery?
    > I have an application that can run as more than one “product”, and each
    > product shows domain-specific variations in labels, for example, in the user
    > interface. There might be a generic term for some object “Foo”, but
    > Application A will call this a “Bar”, and Application B calls it a “Baz”.
    > What I want to be able to do is refer to a “Foo” throughout the source, but
    > substitute “Bar” for App A’s output, and “Baz” for App B’s. What’s the best
    > way to achieve this?
    >
    >
    > --
    > Paul Hoadley
    > http://logicsquad.net/
    >
    >
    >



    --
    Dave Pawson
    XSLT XSL-FO FAQ.
    Docbook FAQ.
    http://www.dpawson.co.uk



  • 3.  Re: [docbook-apps] Alternatives to entities for referencing small substitutions

    Posted 10-18-2016 11:47
    Hi Dave,

    On 18 Oct 2016, at 10:11 PM, Dave Pawson <dave.pawson@gmail.com> wrote:

    > Paul, I now defer to Bob at
    > http://www.sagehill.net/docbookxsl/ which is a most excellent resource.

    Bob’s book is excellent, for sure. I always found your FAQ super-helpful too!


    --
    Paul Hoadley
    http://logicsquad.net/






  • 4.  Re: [docbook-apps] Alternatives to entities for referencing small substitutions

    Posted 10-18-2016 16:14
    Hi Paul,

    Am Dienstag, 18. Oktober 2016, 20:38:00 schrieb Paul Hoadley:
    >
    > What is the state of the art for small text substitutions (basically just
    > domain-specific terms) that can also be varied via the profiling machinery?
    > I have an application that can run as more than one “product”, and each
    > product shows domain-specific variations in labels, for example, in the
    > user interface. There might be a generic term for some object “Foo”, but
    > Application A will call this a “Bar”, and Application B calls it a “Baz”.
    > What I want to be able to do is refer to a “Foo” throughout the source, but
    > substitute “Bar” for App A’s output, and “Baz” for App B’s. What’s the best
    > way to achieve this?

    This sounds like profiling in combination with entities.

    You could define your foo entity like this:

    <phrase
    os='a'>Bar</phrase><phrase
    os='b'>Baz</phrase></phrase>">

    The <phrase> element is quite neutral and is allowed where inline elements are
    also allowed.

    When you have this "foo" entity, you can refer to it throughout your document
    as &foo;. Of course, you need to set the profiling attribute os accordingly to
    filter it for application A or B.

    We use it for different product names and numbers which applies the same
    approach. It works great.

    Keep in mind, this approach relies on a "side effect": it depends on phrase
    being allowed in all contexts. This is not always the case. For example, you
    cannot use &foo; inside attribute values. Or, if you have customized the
    DocBook schema and you don't allow phrase in, let's say, a title. That won't
    work as you will get validation errors.

    Apart from this, I think you will be happy with this approach. ;-))

    --
    Gruß/Regards
    Thomas Schraitle




  • 5.  Re: [docbook-apps] Alternatives to entities for referencing small substitutions

    Posted 10-18-2016 21:24
    On 19 Oct 2016, at 2:44 AM, Thomas Schraitle <tom_schr@web.de> wrote:

    > This sounds like profiling in combination with entities.
    >
    > You could define your foo entity like this:
    >
    > <phrase
    > os='a'>Bar</phrase><phrase
    > os='b'>Baz</phrase></phrase>">
    >
    > The <phrase> element is quite neutral and is allowed where inline elements are
    > also allowed.

    Thanks Thomas, that looks like the approach I need.


    --
    Paul Hoadley
    http://logicsquad.net/






  • 6.  Re: [docbook-apps] Alternatives to entities for referencing small substitutions

    Posted 10-18-2016 21:44
    You could also use catalogs that point to two different entity files based on the target project passed in.

    > On Oct 18, 2016, at 4:24 PM, Paul Hoadley <paulh@logicsquad.net> wrote:
    >
    > On 19 Oct 2016, at 2:44 AM, Thomas Schraitle <tom_schr@web.de> wrote:
    >
    >> This sounds like profiling in combination with entities.
    >>
    >> You could define your foo entity like this:
    >>
    >> <phrase
    >> os='a'>Bar</phrase><phrase
    >> os='b'>Baz</phrase></phrase>">
    >>
    >> The <phrase> element is quite neutral and is allowed where inline elements are
    >> also allowed.
    >
    > Thanks Thomas, that looks like the approach I need.
    >
    >
    > --
    > Paul Hoadley
    > http://logicsquad.net/
    >
    >
    >
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >

    Regards,

    Cathy Riely
















  • 7.  Re: [docbook-apps] Alternatives to entities for referencing small substitutions

    Posted 10-19-2016 02:32
    On 19 Oct 2016, at 8:14 AM, Cathy Riely <criely@apple.com> wrote:

    > You could also use catalogs that point to two different entity files based on the target project passed in.

    Thanks Cathy. I’ll take a look at that option as well.


    --
    Paul Hoadley
    http://logicsquad.net/






  • 8.  Re: [docbook-apps] Alternatives to entities for referencing small substitutions

    Posted 10-19-2016 07:10
    Excellent use of catalogs. Never ceases to amaze me just how useful they are.

    regards Dave P

    On 18 October 2016 at 22:44, Cathy Riely <criely@apple.com> wrote:
    > You could also use catalogs that point to two different entity files based
    > on the target project passed in.
    >
    > On Oct 18, 2016, at 4:24 PM, Paul Hoadley <paulh@logicsquad.net> wrote:
    >
    > On 19 Oct 2016, at 2:44 AM, Thomas Schraitle <tom_schr@web.de> wrote:
    >
    > This sounds like profiling in combination with entities.
    >
    > You could define your foo entity like this:
    >
    > <phrase
    > os='a'>Bar</phrase><phrase
    > os='b'>Baz</phrase></phrase>">
    >
    > The <phrase> element is quite neutral and is allowed where inline elements
    > are
    > also allowed.
    >
    >
    > Thanks Thomas, that looks like the approach I need.
    >
    >
    > --
    > Paul Hoadley
    > http://logicsquad.net/
    >
    >
    >
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >
    >
    > Regards,
    >
    > Cathy Riely
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >



    --
    Dave Pawson
    XSLT XSL-FO FAQ.
    Docbook FAQ.
    http://www.dpawson.co.uk