Page 1 of 1

DocBook5 and XLink

Posted: Mon Feb 18, 2013 1:10 pm
by odeon
Hi,

It would be nice, in oXygen Author, to be able to choose to have the DocBook5 linking dialog include the target reference in @xlink:href rather than in @linkend. The latter is an IDREF and thus wants the target ID to be in the same physical file, which frequently isn't the case when writing modular documentation.

Interestingly, it is already possible to choose a target file when creating the (xref) link. The dialog will happily insert the target ID in a @linkend. Wouldn't it be more logical to use the @xlink:href in those cases, at least, considering that the @linkend will be invalid?

I have a situation where my writers update around 600 or so smaller modules with an occasional xref to another module. The end document will always be one big XML file published as a PDF, but having the contents in small modules is a practical necessity.

Perhaps a fragment identifier for <xref> and <link> (xlink:href="doc.xml#my-id") would be more correct, but in my current case, an ID is enough.

All the best,

Ari Nordström

Re: DocBook5 and XLink

Posted: Mon Feb 18, 2013 5:07 pm
by Radu
Hi Ari,

So you are using Docbook 5 with xi:include, right?

In this case these two constructs should be equivalent for the final output, right?

Code: Select all


<link xlink:href="#paraID">THIS IS MY LINK</link>

Code: Select all


<link linkend="paraID">THIS IS MY LINK</link>
But you'd rather take the first approach because it does not generate validation errors when the ID is not defined in the module which references it?
Because if this is the only reason, you can define a validation scenario which validates the master XML file and which can be used when editing the individual modules:

http://www.oxygenxml.com/doc/ug-oxygen/ ... nario.html

For me the the advantage of the second case is precisely the fact that if the master XML file gets validated and passes, all the internal references are valid (because they have been validated as id-idrefs.

Regards,
Radu

Re: DocBook5 and XLink

Posted: Wed Feb 20, 2013 10:30 am
by odeon
Hi Radu,

These xrefs are simply cross-references that generate a page number reference ("Table 23, page 30" etc) and such in the resulting PDF. The writers use the <xref> element to create that cross-reference.

There is no XInclude involved in any DocBook document--the modules actually have nothing to bind them together. There is, in DocBook format, currently no root XML file that links to them. Instead, the DocBook modules are converted to a publishing format, depending on a lookup file that determines which modules are required by a certain publication, and only then included in a root XML file using XLink-based inclusion links.

So a URI in @xlink:href rather than an IDREF in @linkend is really my only chance to have valid DocBook modules. The modules are stored in eXist so I can easily confirm that the URI is valid, but ID/IDREF pairs just aren't very reuse-friendly.

Best,

Ari

Re: DocBook5 and XLink

Posted: Wed Feb 20, 2013 11:21 am
by Radu
Hi Ari,

Then for Docbook 5 we'll try to add to the dialog used to insert cross refs (xref or link) two radio buttons allowing the user to choose whether he wants to insert an xlink:href or a linkend.
As an example, when an ID for a module called "module.xml" is referenced, the inserted xlink:href should look like:

Code: Select all

<link xlink:href="relative/path/to/module.xml#paraID">THIS IS MY LINK</link>
Do you agree with this?

Regards,
Radu

Re: DocBook5 and XLink

Posted: Tue Feb 26, 2013 12:20 pm
by odeon
Sorry for not replying sooner.

Thanks, Radu, that's an excellent solution.

Best,

/Ari

Re: DocBook5 and XLink

Posted: Tue Jun 11, 2013 3:53 pm
by Radu
Hi Ari,

We released Oxygen 15.0 a couple of days ago and it should contain the improvements we discussed in this thread.

Regards,
Radu