cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Highlight text between change elements in Styler

lfuellenbach
1-Newbie

Highlight text between change elements in Styler

Hello,


I'm wondering if it's possible to highlight the text between two change elments in Styler?


Example: <para>The quick brown fox <revst/>jumps over the<revend/> lazy dog.</para>


I want to set a highlight color on the text between the <revst/> and <revend/> elments. Is this possible in Styler? Maybe using FOSI? Any help would be greatly appreciated.


Thanks, Lisa

4 REPLIES 4

I am not that familiar with Styler, but I know you could do it in FOSI and if I recall Styler uses many FOSI concepts.

In your ‘change’ element e-i-c (or whatever Styler calls it) set the color to whatever you want. If you use two tags for change (e.g., <start-change/> and <end-change/>) then make sure you turn the coloring off in the <end-change> tag.



Lynn


I can't see what is going on in your example (not sure if my browser or
gmail or something else ate it), but for what it's worth, I wrote some code
that would search for and highlight non-breaking spaces and (I think) the
words joined by it. This was ACL that searched for occurrences, and
inserted pub font PIs. Of course, this required code to remove it. And
print stylesheet instructions to ignore it.

As I said, I'm not sure exactly what you're trying to achieve or whether or
not this code might be helpful. I think I posted it to adepters before so
if you can search the archives, you might be able to turn it up. Or I can
resend it.

I don't think I'm being modest when I caution it was kind of kludgy ...



On Thu, Feb 12, 2015 at 5:44 AM, Lynn Hales <->
wrote:

> I am not that familiar with Styler, but I know you could do it in FOSI and
> if I recall Styler uses many FOSI concepts.
>
> In your 'change' element e-i-c (or whatever Styler calls it) set the color
> to whatever you want. If you use two tags for change (e.g., <start-change/>
> and <end-change/>) then make sure you turn the coloring off in the
> <end-change> tag.
>
>
>
> Lynn
>
>
>
> *From:* Lisa Fuellenbach [

Lisa,
When you say "text between two change elements," it sounds like you mean two singleton elements, not a tag pair, with one singleton indicating the start of the changed material, and the other indicating the end of the changed material. For example, <revst> and <revend>. NOTE: According to the documentation, singleton change tags are available only with SGML, not XML.

A change element that is a tag pair is easily supported in Styler. Just add an Element to the stylesheet and set its Font Text color as desired.
However, singletons are different.Formatting generally applies to element content or generated content, but singleton elements have no content. So you cannot change the color of text between two singleton change elements via their Styler Elements.
There are things you can do, though. You can specify Font Text shading in Styler for the singleton change tags so they have a colored background and stand out in the Edit window. For instance, green for the start change element and red for the end change element. That would not affect print/PDF output.
To affect print/PDF output and/or the Edit window, you could use scripting as Paul suggested to insert a <_font> Touchup processing instruction around the text between change start and change end tags:

<revst><_font>This content changed.<_font><revend>

You don't have to set any formatting properties on <_font> because you can use the Styler stylesheet to control what <_font> does. You can add an element for _font and code Font Text color for Edit window and/or print/PDF output. When the color should not appear, just modify the stylesheet.
If an attribute setting is available to control text highlighting, you can code a Condition for <_font> that turns color on and off, or changes color. Or maybe another type of Condition would work foryou.
If you need assistance with the ACL script, I suggest asking Adepters. The ACL gurus are very knowledgeable and are generally happy to help.
Please let me know any questions.
Good luck!
Suzanne Napoleonwww.FOSIexpert.com"WYSIWYG is last-century technology!"


I should note that the advantage of singleton change tags is that they can be in different elements. For example:


<para>...<revst>This content changed.</para><para>This content also changed.<revend>...</para>

However, the <_font> tag pair must start and end in the same context. For example:

<para>...<revst><_font>This content changed.</para><para><_font>This content also changed.<revend>...</para>
Also, you can define a user tag for <_font>, as described in the attached PDF from my book and in Arbortext Editor Help. For example, if you want the changed text to be red, you can make that the name of the UDT.

Good luck!Suzanne
Top Tags