Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is the "Example: Key definition with key reference" page correct? #348

Open
ChrisTrenkamp opened this issue Feb 18, 2020 · 1 comment
Open
Milestone

Comments

@ChrisTrenkamp
Copy link

ChrisTrenkamp commented Feb 18, 2020

http://docs.oasis-open.org/dita/dita/v1.3/errata02/os/complete/part3-all-inclusive/archSpec/base/example-keydef-with-keyref.html

In this example, the key reference to widget resolves to widgetInfo.dita. This took me by surprise because its behavior is inconsistent with the way linking generally works everywhere else in the specification. I would expect it to resolve to http://example.com/productPage.

http://docs.oasis-open.org/dita/dita/v1.3/os/part3-all-inclusive/archSpec/base/processing-key-references-general.html

The spec says that if both the keyref and href is present, the href must be used as a fallback when the keyname is unresolved.

I then tested this in DITA-OT:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map>
  <topicref keyref="widget"/>
  <topicref keys="widget" href="http://test1" keyref="mainProduct" scope="external">
    <topicmeta><navtitle>Information about Widget</navtitle></topicmeta>
  </topicref>
  <topicref keys="mainProduct" href="http://test2" scope="external">
  </topicref>
</map>
<!DOCTYPE html
  SYSTEM "about:legacy-compat">
<html lang="en">
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta charset="UTF-8">
      <meta name="copyright" content="(C) Copyright 2020">
      <meta name="DC.rights.owner" content="(C) Copyright 2020">
      <meta name="DC.type" content="map">
      <meta name="DC.format" content="HTML5">
      <link rel="stylesheet" type="text/css" href="commonltr.css">
      <title></title>
   </head>
   <body>
      <nav xmlns:dita="http://dita-ot.sourceforge.net">
         <ul class="map">
            <li class="topicref"><a href="http://test2" target="_blank">Information about Widget</a></li>
            <li class="topicref"><a href="http://test2" target="_blank">Information about Widget</a></li>
            <li class="topicref"><a href="http://test2" target="_blank">http://test2</a></li>
         </ul>
      </nav>
   </body>
</html>

Even DITA-OT agrees that the widget example is inconsistent. Even tags like <xref keyref="widget"/> resolve to http://test2.

Is the widget example correct?

@robander
Copy link
Contributor

Discussed at the OASIS meeting today, and we agree that you are correct -- the example is incorrect.

The @href attribute, even on the key definition, is there as fallback for when the keyref itself does not resolve.

Thanks - we will update this example for DITA 2.0.

@robander robander added this to the DITA 2.0 milestone Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants