[oXygen-user] CSS background color based on text matches

Robert Leif rleif at rleif.com
Fri Mar 9 22:45:23 CST 2018


Hi Amanda

Can you use XSD1.1 instead of Schematron?

Thank you.

Bob

Robert C. Leif, Ph.D.

rleif at rleif.com

 

From: oXygen-user <oxygen-user-bounces at oxygenxml.com> On Behalf Of Amanda
Galtman
Sent: Friday, March 9, 2018 10:47 AM
To: oxygen-user at oxygenxml.com
Subject: [oXygen-user] CSS background color based on text matches

 

Hi,

 

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 .='') ,
')')",
evaluate,dynamic-once);
}

 

Alternate:

 

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 ('')",
evaluate,dynamic-once);
}

Thanks,

Amanda

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20180309/c4660c54/attachment.html>


More information about the oXygen-user mailing list