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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Coloring xml nodes

IlyaYeroshenko
1-Visitor

Coloring xml nodes

Hello!


I use Java (the plugin is made) for modifying the content of the opened XML/SGML files (Arbortext 5.2).


How should I modify the color of the nodes (I mean programming mode)?


As far as I'm concerned, the usage of _font nodes is forbidden (a-la <_font>text). At least it leads to errors in SGML.


Then we should use processing instructions (PI). How should we create them?


The standard Java DOM method createProcessingInstruction() does not work when we deal with SGML.


I think that it's because of the different format of PIs in SGML and XML.


Should we use Acl OID commands/functions?

3 REPLIES 3

Hello Ilya,

I am not sure I fully understand your requirement, but hopefully this will
give you some ideas or prompt you to clarify your requirements for us so we
can answer more helpfully.

One of my authoring teams needs to be able to highlight text profiled for a
particular output in Editor in order to more easily focus their attention
on that content. To achieve this I use a combination of a FOSI screen
stylesheet and an ACL program called from the screen FOSI as a system-func.

This e-i-c (a block of FOSI programming code controlling the formatting, in
this case, of the para element) includes an attribute test (the
<att></att>) that checks the value of a an attribute against the value of
an ACL variable. If they match, then the tag and its contents are
highlighted green.

===FOSI Fragment============
<e-i-c gi="para">
<charlist inherit="1" charsubsetref="block">
</charlist>
<att>
<specval attname="myacl::matches_profiling" attloc="system-func"&lt;br"/>attval="yes">
<charsubset charsubsetref="green"></charsubset>
</att>
</e-i-c>

Hello!


I don't know what is FOSI.


But I use processing instructions (PIs for markup. Ordinary font nodes don't work within SGML (only XML supported).


That's why I have to use PIs which encolor text nodes within XML and SGML.


But these PIs have different format.


Here is a fragment of my Java code:


Object[] objs = {color};
String pi;
if (isSgml_)
pi = MessageFormat.format("is -sgml '''", objs);
else
pi = MessageFormat.format("is -sgml '''", objs);
Acl.execute(pi);

If your authors are looking at content within Arbortext Editor, then there
is usually a screen stylesheet that manages presentation within the Edit
Window. It is possible to edit without one, but I think if you are able to
control the color through the use of PIs, you must be using a screen
stylesheet.

Within Editor, select Help > Session, and then choose the Document tab.
Report what you see on the Editor/Default stylesheet line. It will include
a path and a file name ending in either .style or .fos.

Whatever stylesheet technology you are using, as far as I know, to color
content within Editor, you will need at least two and possibly three things:

1) Markup in the XML. This could be the PIs you hope to avoid. It could be
text, attribute values, or elements. But there must be something to
indicate whether the content is not colored or colored.

2) Stylesheet markup that interacts with #1.

3) The ability to set or un-set a state that interacts with #1 and #2. For
example, a menu item that says Highlight Teacher Text Red and another item
that says Highlight Student Text Blue.

Announcements

Top Tags