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

Amanda Galtman Amanda.Galtman at mathworks.com
Tue Mar 13 06:20:26 CDT 2018


Bob,

Thanks for the idea. Our schema uses RelaxNG, though, so it would be a big change to switch to XSD. The text matching enhancement that was requested would not, by itself, be enough motivation.

Regards,
Amanda

From: Robert Leif [mailto:rleif at rleif.com]
Sent: Friday, March 09, 2018 11:45 PM
To: Amanda Galtman <Amanda.Galtman at mathworks.com>; oxygen-user at oxygenxml.com
Subject: RE: [oXygen-user] CSS background color based on text matches

Hi Amanda
Can you use XSD1.1 instead of Schematron?
Thank you.
Bob
Robert C. Leif, Ph.D.
rleif at rleif.com<mailto:rleif at rleif.com>

From: oXygen-user <oxygen-user-bounces at oxygenxml.com<mailto: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<mailto: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/20180313/77baaa3d/attachment.html>


More information about the oXygen-user mailing list