Allow conref to resolve with warnings for weak constraints #3084 #3097
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.htmlSpecifically, the update:
DOTX012W
, which was used long ago when a topic could not pull from a different document that had more domains. The message template claimedDOTX012W
was unused, which it should have been because we generalize from excess domains, but the message was reused when we added constraint checking.conref:isValid
function to take a parameterfailWeakConstraints
. WhenfailWeakConstraints=true
, any constraint that is not available in the target doc and applies to a shared domain will returnfalse()
(conref is not valid). WhenfailWeakConstraints=false
, only strict constraints will causeconref:isValid
to returnfalse()
.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).The second call to
conref:isValid
causes Saxon to issue an extra warning message when the target doc is completely missing, which made ourconrefmissingfile
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 thexsl: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.