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] Linking to an Unknown Amount of Targets (1:n relationships)?


Hello

If you're using Docbook 5, and as long as we're only talking about 
markup, I think this use case is crying out for extended links.

I would use locator elements in the info of each topic to associate 
label(s) with each topic.

<info xmlns:xl="http://www.w3.org/1999/xlink";>
   <extendedlink xl:role="#see_also_labels">
     <locator xl:label="topic_1"/>
   </extendedlink>
</info>

Then, wherever you want a "see also" list to be generated, I would use 
arc elements (again, in the info of the topic) to point to the label(s) 
that you want to include.

<info xmlns:xl="http://www.w3.org/1999/xlink";>
   <extendedlink xl:role="#see_also_list">
     <arc xl:to="topic_1"/>
     <arc xl:to="topic_2"/>
   </extendedlink>
</info>

You'd need to find or create full URIs to identify the xl:roles and / or 
xl:arcroles, if you choose to use these attributes.

Simon Dew

Technical Author | Stanley Security Solutions
1 Park Gate Close, Bredbury, Stockport SK6 2SZ, U.K.

Simon.Dew@SBDInc.com | +44 (0) 161 406 3400
www.stanleysecuritysolutions.co.uk

Registered Office: Stanley House, Bramble Road, Swindon
Registered in England and Wales No. 181585 VAT No. 232 2446 95

On 19/07/13 17:17, Bob Stayton wrote:

> Hi Thomas,
> If you are using DocBook 5, you might look at using annotations for the
> markup.  By default, the annotation element is not processed by the
> stylesheets, so you are free to define the behavior by creating your own
> templates.
>
> For example, you could put an annotation in the info of each topic to
> identify its group:
>
> <annotation role="group1" annotates="topicid"/>
>
> where 'topicid' is the xml:id of that topic, because annotations are not
> linked by family position.
> The role could list multiple groups that the topic participates in, if
> appropriate.
>
> In the location where you want a See Also list to appear, you could put a
> special para to identify the group:
>
> <para role="seealso">group1</para>
>
> The custom template for that para could use XPath to locate all annotation
> elements whose role attribute matches the group name, and then process the
> elements identified by the topicids as links, presented in a list form.
>
> Bob Stayton
> Sagehill Enterprises
> bobs@sagehill.net
>
> --------------------------------------------------
> From: "Thomas Schraitle" <tom_schr@web.de>
> Sent: Friday, July 19, 2013 6:06 AM
> To: <docbook@lists.oasis-open.org>
> Subject: [docbook] Linking to an Unknown Amount of Targets (1:n
> relationships)?
>
>> Hi,
>>
>> linking in DocBook has a long tradition: usually, we use <xref/>s for
>> internal cross references and <ulinks/> or <link/>s for remote links.
>>
>> All of these elements establish a 1:1 relationship: one source links to
>> one target.
>>
>> What do I use if I need a 1:n relationship (one source, many targets)?
>>
>> For example, my cookbook[1] around DocBook and the DocBook
>> stylesheets contains several topics. Some topics can be grouped
>> thematically. I would like to show this group of links as one unit,
>> preferably under the "See also" section.
>> My idea would be to just mark up topics that belongs to one or
>> more groups and the stylesheet find the other ends automatically.
>>
>> Anybody had this problem before? What markup did you use, what
>> stylesheet magic? Did extended XLinks help?
>>
>> Any recommendations are very appreciated. :-)
>>
>> Thanks!
>>
>>
>> [1] http://doccookbook.sf.net/html/en/index.html
>>
>> --
>> Gruß/Regards,
>>     Thomas Schraitle
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: docbook-unsubscribe@lists.oasis-open.org
>> For additional commands, e-mail: docbook-help@lists.oasis-open.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-help@lists.oasis-open.org
>
>


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