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


Help: OASIS Mailing Lists Help | MarkMail Help

dita message

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

Subject: keyref and -dita-use-conref-target


Last week we discussed Jarno's question about the "-dita-use-conref-target"
token. Here is an explanation and some samples to use for discussion.

As a refresher: when using conref, attributes on the referencing element
override those on the referenced element. For example, when you resolve the
following conref, the @outputclass attribute will be preserved even if
@outputclass is also specified on the referenced paragraph; if other
attributes are specified on the referenced paragraph (such as @importance),
they will be pulled with the content:
<p outputclass="sample" conref="other.dita#topic/p"/>

When any attribute is required, it is impossible to construct a conref
without specifying that attribute. The "-dita-use-conref-target" token is a
way to say "I have to specify this attribute for whatever reason, but I
don't want it to override the equivalent attribute on the referenced
element." For example, in this imagined element, resolving conref will
still pull @href from the element in other.dita:
<my-special-image href="-dita-use-conref-target"

Note that for conref processors it does not matter if a DTD or Schema
actually defines the attribute as REQUIRED; processing is based on the
token rather than the DTD/XSD. A longer explanation and full example are
available in [1]. So on to Jarno's question: the specification today says
contains the following language about resolving keys [2]:
"The attributes that are common to a key definition element and a key
reference element using that key, other than the @keys, @processing-role,
and @id attributes, are combined as for content references, including the
special processing for the @xml:lang, @dir, and @translate attributes. "

This raised the question of whether the special processing for
-dita-use-conref-target also applies to keys. Assume that I have the
following key definition:
<keydef keys="video" format="mp4" scope="local" href="tutorial.mp4" />
And the following references:
1. <xref keyref="video" scope="external"/>
2. <xref keyref="video" scope="-dita-use-conref-target"/>

Based on the spec, in #1 the @scope attribute on <xref> overrides @scope on
the referenced key, so the resolved element should be:
<xref keyref="video" scope="external" format="mp4" href="tutorial.mp4"/>

In #2, is it correct to assume that the "-dita-use-conref-target" works the
same as it does for conref? If so, the resolved element should be:
<xref keyref="video" scope="local" format="mp4" href="tutorial.mp4"/>

Somewhat related to this, I'd be interested in following up on a related
example that does not use the conref token. Assume I have the following key
<keydef keys="blobexample" href="localblob.dita" format="dita"

Now, I have a reference with fallback link information in case the key is
<xref keyref="blobexample" href="http://www.example.com"; format="html"

Based on the spec, it seems that the fallback @href is replaced, but
@format and @scope override the key definition, giving the following
resolved xref:
<xref keyref="blobexample" href="localblob.dita" format="html"

Is that correct? I think this is what the spec would require, but in the
past we've discussed how @format and @scope are unusual because they are so
closely tied to the @href value. So, I just want to verify.

Thanks -


Robert D Anderson
IBM Authoring Tools Development
Chief Architect, DITA Open Toolkit (http://dita-ot.sourceforge.net/)

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