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


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

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

Subject: Re: [docbook] Macros / Entities with custom parameters?

On Thu, Sep 04, 2003 at 11:14:06AM +0200, Antoine Calando wrote:
> Hi,
> I'm trying to find how to write some kind of macro or entity with custom parameters
> that are reused when the entity is expanded. I am not sure it is very clear, so
> here is an example :
> I want something like "&dbtag($$$$$);"
> (where dbtag is the entity name, and $$$$$ is a parameter like "section" for instance)
> to be expanded in :
> <ulink url="url_to_docbook_doc/$$$$$"> <sgmltag>$$$$$</sgmltag></ulink>
> I search in the DocBook and XML docs but I cannot find anything. May be with SGML?
> The better workaround I found would be to do (if $$$$$ is used 2 times):
> "&macro_beginning; $$$$$$$ &macro_middle; $$$$$$$ &macro_end;"
> but this not very elegant...
> An other way would be to add a new tag in the dtd and also new xslt rules to handle
> it but that's too much work!
> If anyone could at least confirm that it's not possible...

Well, there is no such syntax or functionality
associated with entities.  They are pretty much 
simple substitution.  They don't take dynamic
values like a function.

But you could accomplish something similar with a
stylesheet customization of sgmltag.  You could put
something like this in your document:

<sgmltag role="dbreference">$$$$$</sgmltag>

and a stylesheet customization that starts with:

<xsl:template match="sgmltag[@role = 'dbreference']">

could generate the link syntax appropriate
to the output.


Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The SCO Group                               fax:   (831) 429-1887
                                            email: bobs@sco.com

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