Page 1 of 1

Hot links in schematron error messages

Posted: Thu Oct 19, 2017 7:22 pm
by dcramer
In my schematron message, I sometimes include hyperlinks to point the user to a source for more information about their problem:

Code: Select all


        <sch:rule context="db:book|db:part|db:section|db:chapter|db:appendix|db:preface|db:table|db:figure|db:simplesect">
<sch:assert test="@xml:id">xml:id required on <xsl:value-of select="local-name(.)"/>. https://example.com/wiki/xmlid-attributes</sch:assert>
</sch:rule>
Is there some markup I can add to make these links hot when they view the message in Oxygen?

Thanks,
David

Re: Hot links in schematron error messages

Posted: Thu Oct 19, 2017 7:28 pm
by dcramer
Another, similar approach would be to support some kind of help content inside the framework, such that I could add something to map certain error to certain help, then Oxygen adds a help icon or link to the message opening the help content.

A hot link is fine too, especially if it's also hot in the Errors tab. I worry that many users won't know to do Show Message. Or perhaps double clicking on a message in the Errors tab should be the same as Right-Click->Show Message.

David

Re: Hot links in schematron error messages

Posted: Fri Oct 20, 2017 8:27 am
by xephon
The right way is to use the "see" attribute on the rule element.

Re: Hot links in schematron error messages

Posted: Fri Oct 20, 2017 10:28 am
by tavy
Hello David,

If you want to add link to the Schematrom message you must specify the link in the value of the @see attribute. The attribute can be added on the report/assert element or on the rule (as "xephon" said). The links are presented as a clickable icon, both on the tooltip that is presented when you hover over an error in editor, and in the results view. For your example the Schematron rule should look like this:

Code: Select all


<sch:rule context="db:book|db:part|db:section|db:chapter|db:appendix|db:preface|db:table|db:figure|db:simplesect">
<sch:assert test="@xml:id" see="https://example.com/wiki/xmlid-attributes.html">
xml:id required on <xsl:value-of select="local-name(.)"/>.</sch:assert>
</sch:rule>
If you want to add some a help inside a framework you can use a catalog to redirect the links to the local help. For this you must create a catalog file, and add it to your framework using the Catalogs tab from the Document Type configuration dialog box.
For your example the catalog can look like the one below:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD XML Catalogs V1.1//EN" "http://www.oasis-open.org/committees/entity/release/1.1/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<rewriteURI uriStartString="https://example.com/wiki" rewritePrefix="doc/"/>
</catalog>
Redirects all the links to the "https://example.com/wiki", to your local "doc" folder.

You can read more about how to configure a catalog here:
https://www.oxygenxml.com/doc/versions/ ... alogs.html
https://www.oxygenxml.com/doc/versions/ ... alogs.html

Best Regards,
Octavian

Re: Hot links in schematron error messages

Posted: Mon Oct 23, 2017 6:54 am
by dcramer
Perfect!

Thanks,
David

Re: Hot links in schematron error messages

Posted: Tue Mar 02, 2021 7:04 pm
by HugginD0S
Thank you, I found this helpful. I was able to add a URL to a rule. The link appears as a small icon in the rule message. Is there a way to add link text to the rule so that the URL appears as text?

Re: Hot links in schematron error messages

Posted: Wed Mar 03, 2021 1:49 pm
by tavy
Hello,

Thanks for your feedback.
Unfortunately, you cannot add the text link in the message. We have an issue on our issue tracker to add this support in a future version. I added your comment on the issue and increased its priority. When the issue will be implemented we will update this thread.

Best Regards,
Octavian

Re: Hot links in schematron error messages

Posted: Wed Mar 03, 2021 6:58 pm
by HugginD0S
Ok, thank you for your quick reply and attention to this.

Re: Hot links in schematron error messages

Posted: Fri Mar 05, 2021 11:41 pm
by HugginD0S
Some background on our need for link text-- we're using Schematron to provide rules, but we also see potential in using Schematron to provide guidance. For rules on guidance, we need to link each rule message to more information so that the user can make an informed decision.

Re: Hot links in schematron error messages

Posted: Mon Mar 08, 2021 11:39 am
by tavy
Thanks for you feedback.

We have a sample implementation of an intelligent integrated style guide, that works both in Oxygen XML Editor and Oxygen XML Web Author.
https://github.com/oxygenxml/integrated-styleguide

Best Regards,
Octavian