
The "Schematron & Schematron Quick-Fix In oXygen" session at the oXygen Users Meetup at XML Prague 2016 (http://oxygenxml.com/events/2016/oXygen-user-meetup-Prague.html, but page title says "Prague 2015") is to include "multilingual messages". I can't find anything about that in the oXygen 17.1 manual. How is it done? Regards, Tony Graham. -- Senior Architect XML Division Antenna House, Inc. ---- Skerries, Ireland tgraham@antenna.co.jp

Hello, The Schematron multilingual messages support will be available in the next oXygen version. The presentations from the XML Prague 2016 oXygen User Meetup are containing both features that are available in oXygen 17.1 and features that will be available in the next oXygen version. We will wait you at the presentation to discuss the features and give us feedback. Thank you for telling us about the page title, we fixed it. Best Regards, Octavian -- Octavian Nadolu <oXygen/> XML Editor http://www.oxygenxml.com On 11.01.2016 14:27, Tony Graham wrote:
The "Schematron & Schematron Quick-Fix In oXygen" session at the oXygen Users Meetup at XML Prague 2016 (http://oxygenxml.com/events/2016/oXygen-user-meetup-Prague.html, but page title says "Prague 2015") is to include "multilingual messages". I can't find anything about that in the oXygen 17.1 manual. How is it done?
Regards,
Tony Graham.

On 11/01/2016 13:24, Oxygen XML Editor Support (Octavian Nadolu) wrote:
The Schematron multilingual messages support will be available in the next oXygen version. The presentations from the XML Prague 2016 oXygen User Meetup are containing both features that are available in oXygen 17.1 and features that will be available in the next oXygen version. We will wait you at the presentation to discuss the features and give us feedback.
I look forward to it. Currently, for the Japanese version of 'focheck' [1], I'm using a patched version [2] of the open source OmegaT translation memory tool to get whole Schematron files translated. I've implemented l10n lookup from XML property files using XSLT before, but implementing extracting messages to property files and generating translated Schematron files using translated property files seemed like too much effort for just the 'focheck' project. Hindsight is the only perfect science, but I've never understood why multilingual messages wasn't built into Schematron from the beginning. Regards, Tony Graham. -- Senior Architect XML Division Antenna House, Inc. ---- Skerries, Ireland tgraham@antenna.co.jp [1] https://github.com/AntennaHouse/focheck/releases/tag/v0.3.4 [2] http://sourceforge.net/p/omegat/feature-requests/1147/

On 11.1.2016 14:59, Tony Graham wrote:
Currently, for the Japanese version of 'focheck' [1], I'm using a patched version [2] of the open source OmegaT translation memory tool to get whole Schematron files translated. I've implemented l10n lookup from XML property files using XSLT before, but implementing extracting messages to property files and generating translated Schematron files using translated property files seemed like too much effort for just the 'focheck' project.
If Schematron is being compiled to XSLT for runtime then it should be possible to use my Saxon extension http://xmlguru.cz/2006/10/saxon-gettext without need to provide multiple translated Schematron files. Drawback is that is used Gettext and not OmegaT and that I haven't upgraded extension to recent Saxon versions. But it would be nice to have some localization library kind of standardized at least for XSLT. Jirka -- ------------------------------------------------------------------ Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz ------------------------------------------------------------------ Professional XML and Web consulting and training services DocBook/DITA customization, custom XSLT/XSL-FO document processing ------------------------------------------------------------------ OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep. ------------------------------------------------------------------ Bringing you XML Prague conference http://xmlprague.cz ------------------------------------------------------------------

On 11/01/2016 14:32, Jirka Kosek wrote:
On 11.1.2016 14:59, Tony Graham wrote:
Currently, for the Japanese version of 'focheck' [1], I'm using a patched version [2] of the open source OmegaT translation memory tool to get whole Schematron files translated. I've implemented l10n lookup from XML property files using XSLT before, but implementing extracting messages to property files and generating translated Schematron files using translated property files seemed like too much effort for just the 'focheck' project.
If Schematron is being compiled to XSLT for runtime then it should be possible to use my Saxon extension http://xmlguru.cz/2006/10/saxon-gettext without need to provide multiple translated Schematron files.
I've looked at it in the past, though I can't always find it every time that I look for it. My understanding is that for use with the Saxon extension, the Schematron message: name="<value-of select="@name"/>" cannot be used when axf:document-info with name="xmp" is present. it would have to be marked up as: <t:_>name="</t:_><value-of select="@name"/><t:_>" cannot be used when axf:document-info with name="xmp" is present.</t:_> but I was thinking in terms of dumping a properties file where the key is more like: name="{@name}" cannot be used when axf:document-info with name="xmp" is present. so it can be translated as a sentence and so it's possible to rearrange multiple <value-of> if necessary for the translation. (I obviously haven't got as far as inventing shorthands for all of the elements allowed in Schematron messages, let alone supporting foreign elements and attributes.)
Drawback is that is used Gettext and not OmegaT and that I haven't upgraded extension to recent Saxon versions. But it would be nice to have some localization library kind of standardized at least for XSLT.
It's possible to get XLIFF and other formats out of OmegaT, so using OmegaT doesn't preclude using other tools as well. However, I'm not wedded to OmegaT: it's just that it's a good-enough free solution for a small-scale problem that I had. So having a good, standard, batch method for XSLT would still be a good idea. However, since we're talking about Schematron in general, not all Schematron is run using XSLT. Regards, Tony Graham. -- Senior Architect XML Division Antenna House, Inc. ---- Skerries, Ireland tgraham@antenna.co.jp

On 11.1.2016 19:30, Tony Graham wrote:
I've looked at it in the past, though I can't always find it every time that I look for it.
My understanding is that for use with the Saxon extension, the Schematron message:
name="<value-of select="@name"/>" cannot be used when axf:document-info with name="xmp" is present.
it would have to be marked up as:
<t:_>name="</t:_><value-of select="@name"/><t:_>" cannot be used when axf:document-info with name="xmp" is present.</t:_>
but I was thinking in terms of dumping a properties file where the key is more like:
name="{@name}" cannot be used when axf:document-info with name="xmp" is present.
so it can be translated as a sentence and so it's possible to rearrange multiple <value-of> if necessary for the translation.
If you need rearranging then you can use t:format function, something like: <value-of select="t:format('name="{1}" cannot be used when axf:document-info with name="xmp" is present.', (@name))"/> Which would be very close to your approach. Of course Gettext was designed for strings so once you need more markup together with placeholders it can get messay. Jirka -- ------------------------------------------------------------------ Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz ------------------------------------------------------------------ Professional XML and Web consulting and training services DocBook/DITA customization, custom XSLT/XSL-FO document processing ------------------------------------------------------------------ OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep. ------------------------------------------------------------------ Bringing you XML Prague conference http://xmlprague.cz ------------------------------------------------------------------

Hello, The localization options are defined in the Schematron specification. You can use the diagnostic element to specify the message in multiple languages. http://www.schematron.com/iso/P8.html#GEN17 There is also an example of a multilingual schema in the Annex G of the Schematron specification: http://www.schematron.com/iso/P27.html#GEN39 <sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" xml:lang="en" > <sch:title>Example of Multi-Lingual Schema</sch:title> <sch:pattern> <sch:rule context="dog"> <sch:assert test="bone" diagnostics="d1 d2"> A dog should have a bone. </sch:assert> </sch:rule> </sch:pattern> <sch:diagnostics> <sch:diagnostic id="d1" xml:lang="en"> A dog should have a bone. </sch:diagnostic> <sch:diagnostic id="d2" xml:lang="de"> Das Hund muss ein Bein haben. </sch:diagnostic> </sch:diagnostics> </sch:schema> Best Regards, Octavian On 11.01.2016 15:59, Tony Graham wrote:
On 11/01/2016 13:24, Oxygen XML Editor Support (Octavian Nadolu) wrote:
The Schematron multilingual messages support will be available in the next oXygen version. The presentations from the XML Prague 2016 oXygen User Meetup are containing both features that are available in oXygen 17.1 and features that will be available in the next oXygen version. We will wait you at the presentation to discuss the features and give us feedback.
I look forward to it.
Currently, for the Japanese version of 'focheck' [1], I'm using a patched version [2] of the open source OmegaT translation memory tool to get whole Schematron files translated. I've implemented l10n lookup from XML property files using XSLT before, but implementing extracting messages to property files and generating translated Schematron files using translated property files seemed like too much effort for just the 'focheck' project.
Hindsight is the only perfect science, but I've never understood why multilingual messages wasn't built into Schematron from the beginning.
Regards,
Tony Graham.

On 12/01/2016 12:24, Octavian Nadolu wrote:
The localization options are defined in the Schematron specification. You can use the diagnostic element to specify the message in multiple languages. http://www.schematron.com/iso/P8.html#GEN17
There is also an example of a multilingual schema in the Annex G of the Schematron specification: http://www.schematron.com/iso/P27.html#GEN39
I'm afraid that supports me rather than you. I added that <diagnostics> to the Schematron and referred to it from an existing <assert>. The result was the same as the last time that I tried it. The error message was the text from the <assert> plus the text from both <diagnostic>: name="author-title" cannot be used when axf:document-info with name="xmp" is present. Diagnostics: [d1] A dog should have a bone. [d2] Das Hund muss ein Bein haben. And that's with 'xml:lang="en"' on the <fo:root>. Putting all of the languages in the one file isn't the best idea anyway since (a) it becomes hard to identify when a change to the file is a change to the text in the base language, and (b) the one file gets changed myriad times as translations catch up with changes in the base text (which makes '(a)' harder). Regards, Tony Graham. -- Senior Architect XML Division Antenna House, Inc. ---- Skerries, Ireland tgraham@antenna.co.jp

Tony Graham et al. Why not use XSD1.1, which includes assertions? Bob Leif -----Original Message----- From: oxygen-user-bounces@oxygenxml.com [mailto:oxygen-user-bounces@oxygenxml.com] On Behalf Of Tony Graham Sent: Tuesday, January 12, 2016 8:13 AM To: oxygen-user@oxygenxml.com Subject: Re: [oXygen-user] Multilingual Schematron messages? On 12/01/2016 12:24, Octavian Nadolu wrote:
The localization options are defined in the Schematron specification. You can use the diagnostic element to specify the message in multiple languages. http://www.schematron.com/iso/P8.html#GEN17
There is also an example of a multilingual schema in the Annex G of the Schematron specification: http://www.schematron.com/iso/P27.html#GEN39
I'm afraid that supports me rather than you. I added that <diagnostics> to the Schematron and referred to it from an existing <assert>. The result was the same as the last time that I tried it. The error message was the text from the <assert> plus the text from both <diagnostic>: name="author-title" cannot be used when axf:document-info with name="xmp" is present. Diagnostics: [d1] A dog should have a bone. [d2] Das Hund muss ein Bein haben. And that's with 'xml:lang="en"' on the <fo:root>. Putting all of the languages in the one file isn't the best idea anyway since (a) it becomes hard to identify when a change to the file is a change to the text in the base language, and (b) the one file gets changed myriad times as translations catch up with changes in the base text (which makes '(a)' harder). Regards, Tony Graham. -- Senior Architect XML Division Antenna House, Inc. ---- Skerries, Ireland tgraham@antenna.co.jp _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com https://www.oxygenxml.com/mailman/listinfo/oxygen-user

Hello, I think the problem with the XSD 1.1 assertions is that you cannot add custom messages. There are some engine specific attributes that can be used to add custom messages. For Xerces you can set the message attribute from the 'http://xerces.apache.org' namespace. For Saxon you can set message attribute from the 'http://saxon.sourceforge.net/' namespace. https://www.oxygenxml.com/doc/versions/17.1/ug-editor/#topics/customizing-as... And I don't know how you can add messages in different languages. Best Regards, Octavian On 13.01.2016 01:23, rleif@rleif.com wrote:
Tony Graham et al. Why not use XSD1.1, which includes assertions? Bob Leif
-----Original Message----- From: oxygen-user-bounces@oxygenxml.com [mailto:oxygen-user-bounces@oxygenxml.com] On Behalf Of Tony Graham Sent: Tuesday, January 12, 2016 8:13 AM To: oxygen-user@oxygenxml.com Subject: Re: [oXygen-user] Multilingual Schematron messages?
The localization options are defined in the Schematron specification. You can use the diagnostic element to specify the message in multiple languages. http://www.schematron.com/iso/P8.html#GEN17
There is also an example of a multilingual schema in the Annex G of the Schematron specification: http://www.schematron.com/iso/P27.html#GEN39 I'm afraid that supports me rather than you. I added that <diagnostics> to
On 12/01/2016 12:24, Octavian Nadolu wrote: the Schematron and referred to it from an existing <assert>. The result was the same as the last time that I tried it. The error message was the text from the <assert> plus the text from both <diagnostic>:
name="author-title" cannot be used when axf:document-info with name="xmp" is present. Diagnostics: [d1] A dog should have a bone. [d2] Das Hund muss ein Bein haben.
And that's with 'xml:lang="en"' on the <fo:root>.
Putting all of the languages in the one file isn't the best idea anyway since (a) it becomes hard to identify when a change to the file is a change to the text in the base language, and (b) the one file gets changed myriad times as translations catch up with changes in the base text (which makes '(a)' harder).
Regards,
Tony Graham. -- Senior Architect XML Division Antenna House, Inc. ---- Skerries, Ireland tgraham@antenna.co.jp _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com https://www.oxygenxml.com/mailman/listinfo/oxygen-user
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com https://www.oxygenxml.com/mailman/listinfo/oxygen-user

On 12/01/2016 23:23, rleif@rleif.com wrote:
Why not use XSD1.1, which includes assertions?
In XSL-FO, most property values can be expressions. The 'focheck' Schematron imports an expression parser written in XSLT, so, to use a contrived example, this doesn't produce a Schematron error: column-count="-1 - -2" but this does: column-count="-2 - -1" If you want to know more about the non-oXygen aspects of 'focheck', you can see http://xmllondon.com/2015/slides/validating-xsl-fo.pdf or http://xmllondon.com/2015/xmllondon-2015-proceedings.pdf#page=143 If you also want to know about the oXygen aspects, come to the oXygen Users Meetup at XML Prague next month. Regards, Tony Graham. -- Senior Architect XML Division Antenna House, Inc. ---- Skerries, Ireland tgraham@antenna.co.jp

Hello Tony, This multilingual support for Schematron will be available in the next oXygen version. Yes, in the current oXygen version you will get all the diagnostics messages when an assert/report fails. The implementation has been changed and you will get only the messages for the specified language. But I think we can discuss more about this at the XML Prague conference. You don't need to keep all the messages in the same Schematron file. You can keep the messages for each language in different files and just include them from the main Schematron file. Or you can separate the messages by categories (important message, errors, warning), it depends how you want them. We have also master file validation for Schematron. When you will edit a module containing the messages you will get the errors from the main file if by mistake you change a diagnostic id. Also we have content completion for the diagnostic ids defiled in other modules. So you can easily refer them. Best Regards, Octavian On 12.01.2016 18:12, Tony Graham wrote:
On 12/01/2016 12:24, Octavian Nadolu wrote:
The localization options are defined in the Schematron specification. You can use the diagnostic element to specify the message in multiple languages. http://www.schematron.com/iso/P8.html#GEN17
There is also an example of a multilingual schema in the Annex G of the Schematron specification: http://www.schematron.com/iso/P27.html#GEN39
I'm afraid that supports me rather than you. I added that <diagnostics> to the Schematron and referred to it from an existing <assert>. The result was the same as the last time that I tried it. The error message was the text from the <assert> plus the text from both <diagnostic>:
name="author-title" cannot be used when axf:document-info with name="xmp" is present. Diagnostics: [d1] A dog should have a bone. [d2] Das Hund muss ein Bein haben.
And that's with 'xml:lang="en"' on the <fo:root>.
Putting all of the languages in the one file isn't the best idea anyway since (a) it becomes hard to identify when a change to the file is a change to the text in the base language, and (b) the one file gets changed myriad times as translations catch up with changes in the base text (which makes '(a)' harder).
Regards,
Tony Graham.

Hi Tony, Octavian implemented an algorithm that tries to extract messages in a single language. I guess one can place diagnostics in a specific language in a separate file. Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 12/01/16 18:12, Tony Graham wrote:
On 12/01/2016 12:24, Octavian Nadolu wrote:
The localization options are defined in the Schematron specification. You can use the diagnostic element to specify the message in multiple languages. http://www.schematron.com/iso/P8.html#GEN17
There is also an example of a multilingual schema in the Annex G of the Schematron specification: http://www.schematron.com/iso/P27.html#GEN39
I'm afraid that supports me rather than you. I added that <diagnostics> to the Schematron and referred to it from an existing <assert>. The result was the same as the last time that I tried it. The error message was the text from the <assert> plus the text from both <diagnostic>:
name="author-title" cannot be used when axf:document-info with name="xmp" is present. Diagnostics: [d1] A dog should have a bone. [d2] Das Hund muss ein Bein haben.
And that's with 'xml:lang="en"' on the <fo:root>.
Putting all of the languages in the one file isn't the best idea anyway since (a) it becomes hard to identify when a change to the file is a change to the text in the base language, and (b) the one file gets changed myriad times as translations catch up with changes in the base text (which makes '(a)' harder).
Regards,
Tony Graham.
participants (6)
-
George Bina
-
Jirka Kosek
-
Octavian Nadolu
-
Oxygen XML Editor Support (Octavian Nadolu)
-
rleif@rleif.com
-
Tony Graham