Schematron XPath format and indent inconsistencies (apparent

Having trouble installing Oxygen? Got a bug to report? Post it all here.
whyme
Posts: 93
Joined: Fri Mar 08, 2013 8:58 am

Schematron XPath format and indent inconsistencies (apparent

Post by whyme »

I am working with a suite of Schematron files that have dependencies (by way of sch:include). When I format and indent the master Schematron files (the including files, not the included), complex XPath expressions in sch:let/@value and sch:assert/@test (but not, strangely, in sch:report/@test) return a well indented XPath expression, but all the color coding has been lost. E.g., this long but nicely colored XPath expression (color not illustrated)...

Code: Select all

<assert test="for $i in (1 to 10), $j in (2 to 50) return if (true()) then $i else $j">This
is a test</assert>
...becomes this, in monochrome:

Code: Select all

<assert
test="
for $i in (1 to 10),
$j in (2 to 50)
return
if (true()) then
$i
else
$j"
>This is a test</assert>
But this is true only in the master schematron files (and not in sch:report/@test). In dependent schematron files, none of this indenting happens, and the color coding is retained.

I've tried various settings in Options / Preferences but nothing seems to change this behavior. My preference would be to have the best of both systems: to have automatic indenting (and clearly marked options in the Preferences to change this behavior) and the XPath expression color-coded. Any thoughts? I'm running version 17.0 build 2015043018 on Mac OS 10.9.5.
florin
Posts: 56
Joined: Wed Jan 05, 2011 10:36 am

Re: Schematron XPath format and indent inconsistencies (appa

Post by florin »

Hello,

It seems that you actually encountered two issues.

The first one is that values of sch:report/@test should be identified as XPath expressions and should be indented like in the case of sch:let/@value and sch:assert/@test.

The second one is that the syntax highlight feature stops working if the values of the attributes, containing the XPath expressions, begin with a new line character.

I've logged these issues and we'll fix them soon.

Regarding the options, there is one single option that controls if oXygen does indent or not the XPath expressions in Schematron files - please see Options > Preferences > Editor / Format / XPath options page. Here, you can disable the "Format XPath code embedded in XSLT, XSD and Schematron files" option. This way, you can get a consistent behavior regarding the XPath expressions indentation.

Best regards,
Florin
Florin Avram
<oXygen/> XML Editor
whyme
Posts: 93
Joined: Fri Mar 08, 2013 8:58 am

Re: Schematron XPath format and indent inconsistencies (appa

Post by whyme »

Thanks, Florin. To that could you add a third bug, that included Schematron files (which always have a rootmost element that is not sch:schema) do not exhibit the same behavior during format/indent as master Schematron files do? Thanks so much.
florin
Posts: 56
Joined: Wed Jan 05, 2011 10:36 am

Re: Schematron XPath format and indent inconsistencies (appa

Post by florin »

Hi,

Thank you for pointing this out. We'll deal with it along with the other issues.

Best regards,
Florin
Florin Avram
<oXygen/> XML Editor
Radu
Posts: 9451
Joined: Fri Jul 09, 2004 5:18 pm

Re: Schematron XPath format and indent inconsistencies (apparent

Post by Radu »

Hi,

The reported problem should be fixed in the latest Oxygen 17.0 kits available on our web site.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply