[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: [docbook-apps] Alternative to entities?
Hi, We also use XXE and have had the entity problem. We created a ugly solution: if [ ! -z $(ENTITY_FILE) ]; then \ echo Performing entity substitution for $${LOCAL_XML_SOURCE}; \ sed -e 's/^#.*//' -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/\&/\\\&/g' -e 's/\(.*\)=\(.*\)/s\/\#ENTITY#\1#ENTITY#\/\2\/g/g' $(ENTITY_FILE) > entities.tmp; \ sed -f entities.tmp profiled_tmp.xml > prof_ent_tmp.xml; \ This is part of our Makefile for producing PDf's. What we do is adding our own entities to the XML file: #ENTITY#product_name#ENTITY#, then adding product_name to the entity file: product_name=EasyAccess Web. This sed script substitutes the entity with the proper name. Unfortunutaly the writers still see #ENTITY#product_name#ENTITY# in the text, but they still know what it should be substituted with, most of the time. /Kenneth -------------------------------------------------------- Kenneth Johansson Technical Documentation Manager Sectra Imtec AB Teknikringen 20 E-mail: ke-joh AT sectra DOT se SE-583 30 Linköping Phone: +46 13 23 52 00 SWEDEN Web: http://www.sectra.se > -----Original Message----- > From: Gurra Green [mailto:gurra_green@hotmail.com] > Sent: den 17 januari 2005 14:35 > To: docbook-apps@lists.oasis-open.org > Subject: [docbook-apps] Alternative to entities? > > Hello all! > > We are setting up a DocBook environment for user > documentation here and need a way of defining constant text > strings, for example our product name and other "official" > names which 1) might be changed in the future and 2) we want > to be sure to have consistent caseing and other formatting as well. > > I guess the obvious mechanism would be entities as described > e.g. by http://www.sagehill.net/docbookxsl/ModularEntities.html > So far, so good. But our choice of editor is XMLMind which > unfortunately expands all %entity references when reading a > document with the contents of the entity, thus making the > whole idea useless after writing the xml file back to disk. > > 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. > > /Gurra > > _________________________________________________________________ > It's fast, it's easy and it's free. Get MSN Messenger today! > http://www.msn.co.uk/messenger > >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]