This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook-apps] Alternative to entities?


Gurra Green wrote:

Does anybody have any suggestions on alternate methods for accomplishing the same thing? It feels wrong to misuse DocBook because of an incomplete tool, but the XMLMind editor has a number of verynice features why I am reluctant to switching the whole company to another editor. I have googled for others with the same problem, but not found anything. Grateful for any suggestions, including makefile/perl hacks if no "native" DocBook mechanism could be used.

One possible workaround is to use some element as indicator of entity. For example:


<phrase role="ent">productname</phrase>

Then you can add following code into your stylesheets customization layer in order to get phrase replaced by expanded text:

<xsl:template match="phrase[@role='ent']">
<xsl:choose>
<xsl:when test=". = 'productname'">SuperSoft v3.5</xsl:when>
... other xsl:when for handling other "entity" names ...
<xsl:otherwise>
<xsl:message>Undefined replacement text for <xsl:value-of select="."/></xsl:messages>
</xsl:otherwise>
</xsl:choose>
</xsl:template>


This soulution is very easy to implement, only drawback is that you can't see resulting string in XXE. It would be possible to use CSS to replace placeholder with expanded text, but then you must very carefully synchronize CSS and XSL stylesheets. Or you can generate them automaticaly from some common source.

Other solutions would be usage of XInclude or using empty elements in separate namespace as entity replacement.

Jirka

--
------------------------------------------------------------------
  Jirka Kosek     e-mail: jirka@kosek.cz     http://www.kosek.cz
------------------------------------------------------------------
  Profesionální školení a poradenství v oblasti technologií XML.
     Podívejte se na náš nově spuštěný web http://DocBook.cz
       Podrobný přehled školení http://xmlguru.cz/skoleni/
------------------------------------------------------------------

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]