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

Allow conref to resolve with warnings for weak constraints #3084 #3097

Merged
merged 3 commits into from
Oct 18, 2018

Conversation

robander
Copy link
Member

Updates @conref processing around constraints based on this topic in the specification: http://docs.oasis-open.org/dita/dita/v1.3/errata02/os/complete/part1-base/archSpec/base/constraints-conref-compatibility.html

Specifically, the update:

  • Removes the call to DOTX012W, which was used long ago when a topic could not pull from a different document that had more domains. The message template claimed DOTX012W was unused, which it should have been because we generalize from excess domains, but the message was reused when we added constraint checking.
  • Extends the conref:isValid function to take a parameter failWeakConstraints. When failWeakConstraints=true, any constraint that is not available in the target doc and applies to a shared domain will return false() (conref is not valid). When failWeakConstraints=false, only strict constraints will cause conref:isValid to return false().
  • Adds two new messages. One is an error message for failure based on invalid constraints (when the conref is left unresolved). The other is a warning for weak constraints that are not present, so invalid content might be pulled in.
  • The current conref:isValid check that determines whether to resolve the conref will only fail for incompatible strict constraints. This resolves Relax domain requirements for DITA to XDITA conref #3084 because XDITA declares only a weak constraint - so with this update, you can use conref to pull content from full DITA into XDITA (albeit with a warning).
  • If it is valid, we check again if there are incompatible weak constraints; if so, the warning is issued, but conref resolves.

The second call to conref:isValid causes Saxon to issue an extra warning message when the target doc is completely missing, which made our conrefmissingfile test to fail. I'm not sure why. In testing this, I found that just adding an extra <xsl:iftest="conref:isValid($domains,false())"></xsl:if> (inside the xsl:when that tests the same condition) resulted in a new warning message; this happened for my local test as well as on Travis. I've adjusted the integration test to increase the warning count accordingly.

Finally, I've added a new XSPEC test for the conref module, and put in tests for the conref:isValid function that tests all of the new conditions as well as basic conditions.

Robert D Anderson added 3 commits October 10, 2018 16:13
Signed-off-by: Robert D Anderson <robander@us.ibm.com>
Signed-off-by: Robert D Anderson <robander@us.ibm.com>
Signed-off-by: Robert D Anderson <robander@us.ibm.com>
@robander robander added priority/high High severity or high priority issue DITA 1.3 Related to specification feature added in DITA 1.3 preprocess/conref enhancement Changes to an existing feature labels Oct 11, 2018
@robander robander self-assigned this Oct 11, 2018
@robander robander merged commit c195eb9 into dita-ot:develop Oct 18, 2018
@robander robander deleted the hotfix/3084 branch October 18, 2018 15:38
@robander robander added this to the 3.2 milestone Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DITA 1.3 Related to specification feature added in DITA 1.3 enhancement Changes to an existing feature preprocess/conref priority/high High severity or high priority issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Relax domain requirements for DITA to XDITA conref
2 participants