OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

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

Subject: Re: [docbook-apps] Alternative to internal entities?

Another approach is to let the stylesheet resolve a special element,
something like this:

<phrase role="entity">wrkngName</phrase>

<xsl:template match="phrase">
    <xsl:when test="@role = 'entity'">
      <xsl:variable name="entity"><xsl:value-of select="."/></xsl:variable>
        <xsl:when test="$entity = 'wrkngName'">
          <xsl:text>My Real Product Name</xsl:text>
        <!-- Other entity expansions here -->

The nice thing about this approach is that you don't have to mess with the
DTD to get such text expansion.  You define the expansion by the stylesheet
at processing time.  Validation is another issue, of course.

Bob Stayton
Sagehill Enterprises
DocBook Consulting

----- Original Message ----- 
From: "Paul A. Hoadley" <paulh@logicsquad.net>
To: <docbook-apps@lists.oasis-open.org>
Sent: Tuesday, April 27, 2004 1:21 AM
Subject: [docbook-apps] Alternative to internal entities?


Obviously this is not a DocBook-specific question, but are there any
alternatives to internal entities for macro-like text substitution?  I
have pretty much completely moved from PSGML to nxml-mode for DocBook
editing, and I would like to try and eliminate use of DOCTYPEs.
However, I quite like declaring entities in the internal subset for
simple text substitution.  Is there a lighter-weight alternative to
XInclude?  For one application, I used an entity to refer to the
working name for a software package in case it changed.  It seems a
bit excessive to XInclude a separate file to expand what would be,
say, a two character entity to the name of a software package.  Is
there an alternative?



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