Avoiding entities is a good idea anyway. They're inconvenient if you
need to process your source with xslt in a context other than processing
to produce output (e.g. to pretty print it before checking into a
repository or to make some global change to the source files).
David
> -----Original Message-----
> From: Geraint North [mailto:]
> Sent: Thursday, October 18, 2007 4:34 AM
> To: Samuel Wright
> Cc:
> Subject: Re: [docbook-apps] profiling and entities -
>
> We have exactly the same requirement.
>
> Unfortunately, we found that we couldn't use entities,
> because XMLMind (our editor of choice) seems to permanently
> expand them when opening a document, so opening something
> with &OS; becomes "Linux"
> when the document is re-saved.
>
> We have two ways to work around this:
>
> 1. We've added tags to DocBook - TargetOS, ProductName,
> ProductVersion, etc. These tags can contain nothing (not
> even any text), and we've modified the stylesheets to replace
> them with text, based on parameters passed into the xsl preprocessor.
>
> 2. (This is the way that XMLMind recommends) is to use xi:include:
>
> <phrase id = "my_os_phrase">
> <phrase os = "win">Windows</phrase>
> <phrase os = "linux">Linux</phrase>
> </phrase>
>
> And then everywhere you want to mention the OS, just do:
>
> <xi:include pointer="element(my_os_phrase)" />
>
> (XML Mind wraps this up nicely with its "Copy As Reference"
> capability)
>
> If your processor is set up to follow xi:includes, or you
> pre-process them out, this should also do what you want.
> (I've not actually tried this, because I've not got things
> set up for xi:include processing yet)
>
> Thanks,
>
> Geraint North
> Principal Engineer
> Transitive
>
>
> On 17 Oct 2007, at 12:12, Samuel Wright wrote:
>
> > Hi All,
> >
> > I'm trying to publish three very similar documents, from one master.
> > One can do this with profiling,
> >
> > <section os="win">
> > </section>
> > <section os="lin">
> > </section>
> >
> > and then publishing once for each profile. But this gets more
> > complicated if I want to use an entity, and reuse only one lot of
> > text:
> >
> > This works, but is a LOT of overhead
> >
> > <section>
> > <para> sfdfssdf sdfsfsdf sdfdsfdsf <phrase
> > os="lin">&MYENT_LINUX</phrase><phrase
> > os="win">&MYENT_WINDOWS</phrase></para>
> > </section>
> >
> > Is there someway to control entities with profiling
> >
> > I could use
> >
> > <section>
> > <para> sfdfssdf sdfsfsdf sdfdsfdsf &MYOS; </para> </section>
> >
> > but if you use many variables it is a pain to change them
> each time,
> > and could induce errors.
> >
> > Any thoughts on the best way to do this?
> >
> > Thanks
> > Sam,
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
>
> > For additional commands, e-mail: -
> > open.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
>
>
>