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

Re: Hot links in schematron error messages

Posted: Wed Jun 30, 2021 8:11 pm
by HugginD0S
Hi Octavian,

Has there been an update to allowing link text in Schematron messages?

Thanks

Dwight

Re: Hot links in schematron error messages

Posted: Thu Jul 01, 2021 1:44 pm
by Radu
Hi,

We have not yet implemented this feature, I added your feedback to the opened issue and we'll update this forum thread if it gets implemented.
In the meantime the only way for this is to use the @see attribute on the pattern or the assert to provide a link to the documentation for the entire Schematron rule.

Regards,
Radu

Re: Hot links in schematron error messages

Posted: Thu Jul 15, 2021 7:21 am
by HugginD0S
Thanks Radu. Another question related to links: any link that I add to a Schematron message will default to Internet Explorer. I would like to have Chrome as the default browser. Is the default browser for links determined by Schematron or by the DITA authoring tool (we use Oxygen)?

Thanks again!

Dwight

Re: Hot links in schematron error messages

Posted: Thu Jul 15, 2021 2:31 pm
by tavy
Hello Dwight,

Oxygen opens the links in the system default browser. You can set a different browser from Options >Preferences->Global option page, by changing the "Default Internet browser" option.

https://www.oxygenxml.com/doc/versions/ ... qn_bgk_54b

Best Regards,
Octavian

Re: Hot links in schematron error messages

Posted: Thu Jul 15, 2021 8:03 pm
by HugginD0S
Hi Octavian,

Thank you for your quick reply. The menu options on the version of iXiasoft that I'm using are a little different. To reach an option for changing the default browser in Oxygen, the following route is available:

Window > Preferences > General > Web Browser

On the Web Browser panel, I have these options:

Use internal web browser
Use external web browser

Under "External browsers" are these options:

Default system web browser
Firefox
Internet Explorer
Chrome
  • I have selected Chrome, chose Apply > Apply and Close. The link in the Schematron message opens in IE.
  • I have done the same but restarted iXiasoft. Same result.
  • I have set the default browser on my computer to Chrome, and in the options under External browsers chose Default system web browser. Same result.
If you have any suggestions, please LMK.

Thanks again!

Dwight

Re: Hot links in schematron error messages

Posted: Fri Jul 16, 2021 2:01 pm
by tavy
Hi Dwight,

Yes, for the Eclipse plugin we do not have the "Default Internet browser" option, and it seems that in this case we do not use the Web Browser option from the Eclipse settings.
The solution that I see in this case is to make sure the Chrome is set as default browser on your system. If you open an html file from the from the file system what browser is used?

Best Regards,
Octavian

Re: Hot links in schematron error messages

Posted: Fri Jul 16, 2021 6:23 pm
by HugginD0S
Hi Octavian,

The solution that I see in this case is to make sure the Chrome is set as default browser on your system. If you open an html file from the from the file system what browser is used?
Answer: Chrome. I've worked with our IT support team to set Chrome as the default browser on my system. Any link on my machine will open Chrome by default.

Is there a way to modify the Eclipse plugin to have it default to opening Chrome to run links?

Thanks!

Dwight

Re: Hot links in schematron error messages

Posted: Tue Jul 20, 2021 5:35 pm
by adrian
Hello,

What version of the Oxygen plugin for Eclipse are you using (Window > Preferences > Oxygen XML Editor) and what version of the Eclipse platform (Help > About, Eclipse Platform), if any is visible?

Please check the default system browser for the http and https protocols. Note that file associations (like .html) are not involved in this case.
Open a Command Prompt or Run box and type:

Code: Select all

start http://www.oxygenxml.com
and

Code: Select all

start https://www.oxygenxml.com
The Oxygen website will open in the default browser for the respective protocol. This is just to confirm the default browser.

Regards,
Adrian

Re: Hot links in schematron error messages

Posted: Tue Jul 20, 2021 10:52 pm
by HugginD0S
Hi Adrian,

Thanks for your help.

>What version of the Oxygen plugin for Eclipse are you using (Window > Preferences > Oxygen XML Editor)...

XML Author 21.1, build 2019090904

>what version of the Eclipse platform (Help > About, Eclipse Platform)...

Version: Oxygen.3a (4.7.3a)
Build id: M20180330-0640

>Please check the default system browser for the http and https protocols. Open a Command Prompt or Run box and type:
>start http://www.oxygenxml.com
and
>start https://www.oxygenxml.com

From a Command Prompt in DOS, those commands open each protocol in Chrome.

Best regards,

Dwight

Re: Hot links in schematron error messages

Posted: Thu Jul 22, 2021 10:26 am
by adrian
Hello,

We have tested with your exact build, XML Author 21.1, build 2019090904 on two versions of Eclipse, Version: 2018-12 (4.10) Build id: I20181206-0815 and Version: Oxygen.3a Release (4.7.3a) Build id: 20180405-1200.
It behaves correctly on both, the default browser was opened.

These are the test files that I used:
sample.xml

Code: Select all

<?xml-model href="sample.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<a/>
sample.sch

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2"
    xmlns:sqf="http://www.schematron-quickfix.com/validator/process">
    <sch:pattern>
        <sch:rule context="a">
            <sch:assert test="false()" see="https://www.oxygenxml.com">Click the icon for more</sch:assert>
        </sch:rule>
    </sch:pattern>
</sch:schema>
I opened sample.xml and an error was highlighted on <a/>. Keeping the mouse pointer over <a/> showed a tooltip window with the message "Click the icon for more". Clicking on the book icon from that window, opened the default browser (Firefox in my case).
I even changed the default browser from Firefox to Edge and it opened in Edge.

If possible, please test with the same files.

Regards,
Adrian

Re: Hot links in schematron error messages

Posted: Tue Jul 27, 2021 7:33 pm
by HugginD0S
<resolved>
Thank you for your help Adrian, Octavian, and Radu. The problem is solved-- Oxygen now resolves links according to the Default Browser settings. When I set the Chrome as the default browser, links are resolved in Chrome. When I change the Default Browser setting to "Firefox", links are resolved in Firefox. Now I just have to determine what exactly fixed the problem! Here's what I did::
  • Disabled Microsoft Bing. Bing seems to masquerade as IE. I had disabled IE as the default browser on my system and tested to ensure that links on my system would default to Chrome. It may be that Bing was opening by default, and not IE. .
    After disabling Bing from my system, the Default Browser settings worked. However, I'm not sure if disabling Bing is what truly solved the issue.
  • Ran tests using the sample code that you provided in this thread, thank you. This worked. However, after this success, I ran tests using the old SCH file I''d been using, and the issue was still resolved.
  • Exited the Eclipse plug-in, restarted it, and then tested the links each time I changed a setting under Default Browser,. This worked and may in fact be the actual solution to the issue..
    I was sure that I had tried that approach before. But without a solid QA plan to follow, I can't be 100% certain.
Thank you again for your help with this issue. I will check this thread periodically to see if link text is implemented.

Best,
Dwight