<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle23
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:windowtext">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 behavior.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">I’ll keep the </span><tt><span style="font-size:10.0pt">StylesFilter</span></tt><span style="color:windowtext"> 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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">Amanda<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="color:windowtext">From:</span></b><span style="color:windowtext"> oXygen-user [mailto:oxygen-user-bounces@oxygenxml.com]
<b>On Behalf Of </b>Alex Jitianu<br>
<b>Sent:</b> Monday, March 12, 2018 4:33 AM<br>
<b>To:</b> oxygen-user@oxygenxml.com<br>
<b>Subject:</b> Re: [oXygen-user] CSS background color based on text matches<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Dear Amanda,<o:p></o:p></p>
<p>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 background).
<o:p></o:p></p>
<p><img width="152" height="51" style="width:1.5833in;height:.5312in" id="_x0000_i1025" src="cid:image001.png@01D3BA9C.90F387E0"><o:p></o:p></p>
<p>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?<o:p></o:p></p>
<p>Another option would be to use our Java based API and set a <tt><span style="font-size:10.0pt">StylesFilter</span></tt> [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. <o:p></o:p></p>
<p>[1] <a href="https://www.oxygenxml.com/doc/versions/19.1/ug-editor/topics/dg-author-css-styles-filter.html">
https://www.oxygenxml.com/doc/versions/19.1/ug-editor/topics/dg-author-css-styles-filter.html</a><o:p></o:p></p>
<pre>Best regards,<o:p></o:p></pre>
<pre>Alex<o:p></o:p></pre>
<pre>-- <o:p></o:p></pre>
<pre>Alex Jitianu<o:p></o:p></pre>
<pre><oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger<o:p></o:p></pre>
<pre><a href="http://www.oxygenxml.com">http://www.oxygenxml.com</a> <o:p></o:p></pre>
<div>
<p class="MsoNormal">On 3/9/2018 8:47 PM, Amanda Galtman wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">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).<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Before I give up, though, I wanted to see if anyone had specific ideas or techniques I might have overlooked.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Here’s an example of variations I tried that work too slowly in large documents, just to give you the flavor.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt">/*  true => 255*1 => white<br>
*  false => 255*0 => yellow */<br>
refentry[role="function"] literal  { <br>
background-color: oxy_xpath(  <br>
"concat('rgb(255,255,', 255 * number(. = ancestor::refentry//term or .='') , ')')",<br>
evaluate,dynamic-once);<br>
}</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal">Alternate:<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="background:white;text-autospace:none"><span style="font-size:12.0pt">refentry[role="function"] literal {
<br>
background-color: oxy_xpath( <br>
"if (exists(text()) and not(some $n in ancestor::refentry/refsect1[@role=('inputs','outputs')]//term satisfies string($n)=.)) then ('yellow') else ('')",<br>
evaluate,dynamic-once);<br>
}<br>
<br>
<br>
</span><o:p></o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Amanda<o:p></o:p></p>
<p class="MsoNormal"><br>
<br>
<br>
<o:p></o:p></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>oXygen-user mailing list<o:p></o:p></pre>
<pre><a href="mailto:oXygen-user@oxygenxml.com">oXygen-user@oxygenxml.com</a><o:p></o:p></pre>
<pre><a href="https://www.oxygenxml.com/mailman/listinfo/oxygen-user">https://www.oxygenxml.com/mailman/listinfo/oxygen-user</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>