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:rl...@rleif.com]
Sent: Friday, March 09, 2018 11:45 PM
To: Amanda Galtman <amanda.galt...@mathworks.com>; oxygen-user@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.
rl...@rleif.com<mailto:rl...@rleif.com>

From: oXygen-user 
<oxygen-user-boun...@oxygenxml.com<mailto:oxygen-user-boun...@oxygenxml.com>> 
On Behalf Of Amanda Galtman
Sent: Friday, March 9, 2018 10:47 AM
To: oxygen-user@oxygenxml.com<mailto:oxygen-user@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
_______________________________________________
oXygen-user mailing list
oXygen-user@oxygenxml.com
https://www.oxygenxml.com/mailman/listinfo/oxygen-user

Reply via email to