Schematron for Multi-Lingual Schemas?

I'm looking at localising the Schematron messages in 'focheck' (https://github.com/AntennaHouse/focheck). The non-normative advice in Annex G, "Use of Schematron for Multi-Lingual Schemas", in the Schematron spec is to use multiple <diagnostic>, one for each translation of the text from an <assert> or <report>. oXygen, unsurprisingly, shows every applicable <diagnostic>. This gets a bit cluttered and, for some user, puts the readable version of the message right at the very end. Is there a way to put multiple, localised versions of a message in a Schematron file and have only the preferred one show? Is there an alternative to making multiple single-language versions of the Schematron? And, while I'm at it, what can be done about l10n of the annotations in Relax NG schema that become tool-tips in oXygen? Regards, Tony Graham. -- Senior Architect XML Division Antenna House, Inc. ---- Skerries, Ireland tgraham@antenna.co.jp

Tony Graham et al. Is this stand-alone Schematron or is it the Schematron that is present in XSD1.1? Robert C. Leif -----Original Message----- From: oxygen-user-bounces@oxygenxml.com [mailto:oxygen-user-bounces@oxygenxml.com] On Behalf Of Tony Graham Sent: Wednesday, August 19, 2015 3:48 PM To: oxygen-user@oxygenxml.com Subject: [oXygen-user] Schematron for Multi-Lingual Schemas? I'm looking at localising the Schematron messages in 'focheck' (https://github.com/AntennaHouse/focheck). The non-normative advice in Annex G, "Use of Schematron for Multi-Lingual Schemas", in the Schematron spec is to use multiple <diagnostic>, one for each translation of the text from an <assert> or <report>. oXygen, unsurprisingly, shows every applicable <diagnostic>. This gets a bit cluttered and, for some user, puts the readable version of the message right at the very end. Is there a way to put multiple, localised versions of a message in a Schematron file and have only the preferred one show? Is there an alternative to making multiple single-language versions of the Schematron? And, while I'm at it, what can be done about l10n of the annotations in Relax NG schema that become tool-tips in oXygen? Regards, Tony Graham. -- Senior Architect XML Division Antenna House, Inc. ---- Skerries, Ireland tgraham@antenna.co.jp _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

On 20/08/2015 02:16, rleif@rleif.com wrote:
Is this stand-alone Schematron or is it the Schematron that is present in XSD1.1?
Standalone. Most of the Schematron is generated from the XML for the XSL 1.1 Recommendation using XSLT. Regards, Tony Graham. -- Senior Architect XML Division Antenna House, Inc. ---- Skerries, Ireland tgraham@antenna.co.jp

Hello Tony, Unfortunately we do not support multiple languages for the Schematron messages. We have an issue on our issue tracker regarding this problem and I will increase it's priority. The Schematron messages are generated at validation and we need to collect only the diagnostics with the xml:lang equal with the one form the application. Now all the messages are collected, the xml:lang attribute is ignored. If you make multiple single language Schematron files, maybe you can create for each one a validation scenario and depending on the language use the specific validation scenario. But you will need to associate the scenario manually. Or you can create different projects and save the validation scenario and the association in the project, and when you will change the project you will have the specific validation. Other workaround is to use the "phase" mechanism. You can create a Schematron with multiple phases, a phase for each language. At validation oXygen will present a dialog with the phases and you can select the one you want depending on the language. I added an issue also for the annotations, to support multiple languages. Here is the same problem we collect all the annotations without looking at the lang attribute. Best Regards, Octavian -- Octavian Nadolu <oXygen/> XML Editor http://www.oxygenxml.com On 20.08.2015 01:47, Tony Graham wrote:
I'm looking at localising the Schematron messages in 'focheck' (https://github.com/AntennaHouse/focheck).
The non-normative advice in Annex G, "Use of Schematron for Multi-Lingual Schemas", in the Schematron spec is to use multiple <diagnostic>, one for each translation of the text from an <assert> or <report>.
oXygen, unsurprisingly, shows every applicable <diagnostic>. This gets a bit cluttered and, for some user, puts the readable version of the message right at the very end.
Is there a way to put multiple, localised versions of a message in a Schematron file and have only the preferred one show? Is there an alternative to making multiple single-language versions of the Schematron?
And, while I'm at it, what can be done about l10n of the annotations in Relax NG schema that become tool-tips in oXygen?
Regards,
Tony Graham.

On 21/08/2015 08:12, Oxygen XML Editor Support (Octavian Nadolu) wrote:
Unfortunately we do not support multiple languages for the Schematron messages. We have an issue on our issue tracker regarding this problem
Schematron itself doesn't make this easy. I kept expecting there'd be something that would 'just work', but even Annex G reads like an afterthought.
and I will increase it's priority. The Schematron messages are generated
Thanks.
at validation and we need to collect only the diagnostics with the xml:lang equal with the one form the application. Now all the messages
That should work okay. Part of why Annex G reads like an afterthought is that it manages to repeat the 'A dog should have a bone.' text in an 'en' diagnostic. That shouldn't be necessary, IMO.
are collected, the xml:lang attribute is ignored.
If you make multiple single language Schematron files, maybe you can create for each one a validation scenario and depending on the language use the specific validation scenario. But you will need to associate the
That is my current plan. I'm starting with the Schematron since I autogenerate most of it, which means I can localise most of it just by adding a function to the XSLT.
scenario manually. Or you can create different projects and save the validation scenario and the association in the project, and when you will change the project you will have the specific validation.
I was trying to not have to do that, but if I did that, it would mean that I could localise everything, including the project description.
Other workaround is to use the "phase" mechanism. You can create a Schematron with multiple phases, a phase for each language. At validation oXygen will present a dialog with the phases and you can select the one you want depending on the language.
I hadn't thought of that, but that could be an interesting alternative. However, I'd have to see whether that would play nicely with my current use of separate separate phases for FOs, properties, and Antenna House extensions.
I added an issue also for the annotations, to support multiple languages. Here is the same problem we collect all the annotations without looking at the lang attribute.
Thanks. I also autogenerate a lot of the Relax NG as compact syntax. I haven't found a way to annotate '##' annotations with xml:lang, but xml:lang can be added using the less-compact compact syntax, e.g.: axf_footnote-number-citation = [ a:documentation [ xml:lang = "en" 'Cites a footnote number' ] ] element axf:footnote-number-citation { attribute ref-id { text }, empty } However, I'm more likely to just add translations to the XML syntax version after it's been created by 'jing'. But that part of it isn't your problem to solve. Regards, Tony Graham. -- Senior Architect XML Division Antenna House, Inc. ---- Skerries, Ireland tgraham@antenna.co.jp

Hello Tony, If you want to have the annotations in different languages for the the RELAX NG compact syntax you cannot use the shorthand syntax "##": ## Cites a footnote number You will need to use the "less compact syntax": [a:documentation [ xml:lang = "en" 'Cites a footnote number'] ] http://www.relaxng.org/compact-tutorial-20030326.html#id2816874 Best Regards, Octavian On 21.08.2015 13:26, Tony Graham wrote:
On 21/08/2015 08:12, Oxygen XML Editor Support (Octavian Nadolu) wrote:
Unfortunately we do not support multiple languages for the Schematron messages. We have an issue on our issue tracker regarding this problem
Schematron itself doesn't make this easy. I kept expecting there'd be something that would 'just work', but even Annex G reads like an afterthought.
and I will increase it's priority. The Schematron messages are generated
Thanks.
at validation and we need to collect only the diagnostics with the xml:lang equal with the one form the application. Now all the messages
That should work okay. Part of why Annex G reads like an afterthought is that it manages to repeat the 'A dog should have a bone.' text in an 'en' diagnostic. That shouldn't be necessary, IMO.
are collected, the xml:lang attribute is ignored.
If you make multiple single language Schematron files, maybe you can create for each one a validation scenario and depending on the language use the specific validation scenario. But you will need to associate the
That is my current plan. I'm starting with the Schematron since I autogenerate most of it, which means I can localise most of it just by adding a function to the XSLT.
scenario manually. Or you can create different projects and save the validation scenario and the association in the project, and when you will change the project you will have the specific validation.
I was trying to not have to do that, but if I did that, it would mean that I could localise everything, including the project description.
Other workaround is to use the "phase" mechanism. You can create a Schematron with multiple phases, a phase for each language. At validation oXygen will present a dialog with the phases and you can select the one you want depending on the language.
I hadn't thought of that, but that could be an interesting alternative. However, I'd have to see whether that would play nicely with my current use of separate separate phases for FOs, properties, and Antenna House extensions.
I added an issue also for the annotations, to support multiple languages. Here is the same problem we collect all the annotations without looking at the lang attribute.
Thanks. I also autogenerate a lot of the Relax NG as compact syntax. I haven't found a way to annotate '##' annotations with xml:lang, but xml:lang can be added using the less-compact compact syntax, e.g.:
axf_footnote-number-citation = [ a:documentation [ xml:lang = "en" 'Cites a footnote number' ] ] element axf:footnote-number-citation { attribute ref-id { text }, empty }
However, I'm more likely to just add translations to the XML syntax version after it's been created by 'jing'. But that part of it isn't your problem to solve.
Regards,
Tony Graham.
participants (3)
-
Oxygen XML Editor Support (Octavian Nadolu)
-
rleif@rleif.com
-
Tony Graham