Thanks, Alex, for the suggestions. The part about validation being a separate 
execution thread is useful to know. I think the format of Schematron 
errors/warnings is close enough for this purpose. The main reason for starting 
with CSS was to try matching an earlier (pre-Oxygen) authoring environment 

I'll keep the StylesFilter idea in mind in case Schematron does not work out 
for some reason - and also for future tasks where StylesFilter might provide a 
good solution.


From: oXygen-user [] On Behalf Of Alex 
Sent: Monday, March 12, 2018 4:33 AM
Subject: Re: [oXygen-user] CSS background color based on text matches

Dear Amanda,

Using Schematron for validating these requirements is indeed a better approach 
because the validation is done on a separate execution thread and doesn't 
affect the layout.When a rule is broken, the visual indicator is a squiggly 
yellow line (or red, if you want to mark it as an error) which is pretty close 
to the way you are currently marking the element in the CSS rule (a yellow 


A CSS rule will give you more options on how to mark the error: colors, borders 
etc. Do you find the Schematron error marking (the yellow squiggly underline) 
enough or you would prefer to be able to change it to something else?

Another option would be to use our Java based API and set a StylesFilter [1] 
and change the background color from there. In such an extension point you can 
directly navigate the author node model which is faster than executing an XPath.


Best regards,



Alex Jitianu

<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger<>
On 3/9/2018 8:47 PM, Amanda Galtman wrote:

We've had a request from an author to make the formatting in the Author view 
indicate when the text of a certain element type does not match the text of 
something else found inside the same topic. I can do this via Oxygen CSS, but I 
am concerned that the processing slows down the opening of large documents. I'm 
not convinced that CSS is a good way to address the underlying requirement 
about helping authors detect when something does not have a textual match as 
expected (e.g., maybe Schematron or a build warning would be more appropriate).

Before I give up, though, I wanted to see if anyone had specific ideas or 
techniques I might have overlooked.

Here's an example of variations I tried that work too slowly in large 
documents, just to give you the flavor.

/*  true => 255*1 => white
*  false => 255*0 => yellow */
refentry[role="function"] literal  {
background-color: oxy_xpath(
"concat('rgb(255,255,', 255 * number(. = ancestor::refentry//term or .='') , 


refentry[role="function"] literal {
background-color: oxy_xpath(
"if (exists(text()) and not(some $n in 
ancestor::refentry/refsect1[@role=('inputs','outputs')]//term satisfies 
string($n)=.)) then ('yellow') else ('')",



oXygen-user mailing list<><>

oXygen-user mailing list

Reply via email to