DocBook5 and XLink

Are you missing a feature? Request it's implementation here.
odeon
Posts: 33
Joined: Mon Mar 12, 2007 1:56 am
Location: Sweden

DocBook5 and XLink

Post by odeon » Mon Feb 18, 2013 1:10 pm

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

Radu
Posts: 6500
Joined: Fri Jul 09, 2004 5:18 pm

Re: DocBook5 and XLink

Post by Radu » Mon Feb 18, 2013 5:07 pm

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

odeon
Posts: 33
Joined: Mon Mar 12, 2007 1:56 am
Location: Sweden

Re: DocBook5 and XLink

Post by odeon » Wed Feb 20, 2013 10:30 am

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

Radu
Posts: 6500
Joined: Fri Jul 09, 2004 5:18 pm

Re: DocBook5 and XLink

Post by Radu » Wed Feb 20, 2013 11:21 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

odeon
Posts: 33
Joined: Mon Mar 12, 2007 1:56 am
Location: Sweden

Re: DocBook5 and XLink

Post by odeon » Tue Feb 26, 2013 12:20 pm

Sorry for not replying sooner.

Thanks, Radu, that's an excellent solution.

Best,

/Ari

Radu
Posts: 6500
Joined: Fri Jul 09, 2004 5:18 pm

Re: DocBook5 and XLink

Post by Radu » Tue Jun 11, 2013 3:53 pm

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply