[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: AW: [docbook] external entities in docbook
The stylesheet rule (which you'd add to the stock Docbook XSLT stylesheets) would look something like this: <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:param name="mytags.longproductcode" select="'longproductcode'"/> <xsl:template match="longproductcode"> <xsl:value-of select="$mytags.longproductcode"/> </xsl:template> </xsl:stylesheet> This will substitute the "longproductcode" tag with the text contained in the "mytags.longproductcode" parameter. Both xsltproc and saxon provide a means for overriding parameters on the command- line, so you could specify an alternative value for the parameters when you invoke the XSLT processor, thus substituting in the require text. Thanks, Geraint North Principal Engineer Transitive On 19 Nov 2007, at 11:24, Hinrich Aue wrote: > This sounds tempting. I'm using docbook 4. > I guess I have to adapt the DTD then, so the editor (Serna) doesn't > complain. > > What does a stylesheet rule look like? > > Hinrich > > -----Ursprüngliche Nachricht----- > Von: Geraint North [mailto:geraint@transitive.com] > Gesendet: Monday, November 19, 2007 11:58 AM > An: Hinrich Aue > Cc: docbook@lists.oasis-open.org > Betreff: Re: [docbook] external entities in docbook > > Are you using the entities to substitute phrases at document > generation time (i.e. using the XSLT stylesheets)? I've had success > by adding elements to Docbook for the phrases that I need ( <TargetOS/ >> , <ProductName/>, etc.) and writing simple XSLT rules that replace > them with a string provided to the xsltproc or saxon command-line. > > Using this mechanism, the document authors just insert an empty > <ProductName/> element wherever it is required, and the publisher can > generate the documentation for the required product by specifying the > appropriate command-line arguments. > > I initially went down the road of using entities, but abandoned that > route because a) my preferred XML Editor (XMLMind) doesn't support > them in the way that I'd like, and b) difficulty in specifying the > required values cleanly, as you describe. > > I can go into more detail if this approach sounds useful to you. My > experience is with DocBook 5, but I'm sure that the theory is equally > applicable to previous versions. > > Geraint North > Principal Engineer > Transitive > > > On 14 Nov 2007, at 9:15, Hinrich Aue wrote: > >> Hello list, >> >> at the moment we have a reference to a file containing our entitiy >> definitions like this: >> <!ENTITY % myents SYSTEM "Q:/docbook/Tourmalet_en/Variables/ >> Variables.ent"> >> >> This is of course ugly. Is there a different way of providing >> entities into any file without this? >> >> Thanks, >> Hinrich > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: docbook-unsubscribe@lists.oasis-open.org > For additional commands, e-mail: docbook-help@lists.oasis-open.org >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]