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

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

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


Subject: Extending ulink


I have a DocBook document that contains a lot of references to functions 
in someone else's C library.  That library is documented online, and I'd 
like to link the references in my document to the online library 
reference manual.  Stock DocBook gives me all the tools I need to do 
this, but there would be a lot of boilerplate code.  I'd like to have 
the XSL step generate as much of this as possible.

For instance, if the function is foo(), I'd like the DocBook to look 
something like this:

	<apiref fn="foo"/>

and have it generate:

	<function><ulink 
url="http://somewhere.out.there/ref/foo.html";>foo()</ulink></function>

In plain XSLT, this is a straightforward transformation.  My problem is, 
I can't just go and define <apiref>, as that isn't in the DocBook DTD. 
(I always validate my documents...)  I'd rather not modify the DocBook 
stylesheets and such to add it, either.  I'm hoping that there's some 
way I can extend the built-in ulink tag, to specialize it for this purpose.

There's a subtlety: underscores are replaced by dashes in the URLs in 
the online reference manual I want to link to.  That is, if the function 
is foo_bar(), then the generated DocBook should look like this instead:

	<function><ulink 
url="http://somewhere.out.there/ref/foo-bar.html";>foo_bar()</ulink></function>

If that's a fatal monkey wrench, please ignore it, because I'd still 
like the know the answer to the simpler question.  I can probably cope 
by including both versions of the function name to side-step the issue:

	<apiref page="foo-bar">foo_bar</apiref>

It would just be nice if there were a way to automatically do the 
dash-to-underscore change as well.

I have several of the books on the topic, so if this is covered 
somewhere, a reference will work as well.


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