Schematron and Whitespaces

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Stacey
Posts: 44
Joined: Tue Mar 14, 2017 12:36 am

Schematron and Whitespaces

Post by Stacey »

Hi:

I've started working with schematron, and one of the things I've noticed is that it doesn't ignore whitespace when looking for text or whatnot, so it doesn't necessarily pull in all of the error results/matching scenarios. Is there a way to indicated that it should ignore that? Or a quick way to update files to remove "extra whitespaces" in the code?
tavy
Posts: 365
Joined: Thu Jul 01, 2004 12:29 pm

Re: Schematron and Whitespaces

Post by tavy »

Hello,

You can create a Schematron rule that ignores whitespaces when searching for some text. For example you can use the matches() function, or you can normalize the text content. You can create also a fix action to remove the extra spaces. I don't know exactly your use case, maybe you can send me an example of XML and the Schematon and I will try to help you.

Here you can find an example of Schematron rule that checks for spaces at the beginning and end of elements:
https://www.oxygenxml.com/doc/versions/ ... pk_g3d_34b

Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply