Additional CSS Selectors
Oxygen XML Editor plugin provides support for selecting additional types of nodes. These custom selectors apply to: document, doctype sections, processing-instructions, comments, CDATA sections, reference sections, and entities. Processing-instructions are not displayed by default. To display them, open the Preferences dialog box , go to , and select Show processing instructions.
Note
For the custom selectors to work in your CSS stylesheets, declare the Author mode extensions namespace at the beginning of the stylesheet documents:
@namespace oxy url('http://www.oxygenxml.com/extensions/author');
- The
oxy|document
selector matches the entire document:oxy|document { display:block !important; }
- The following example changes the rendering of doctype sections:
oxy|doctype { display:block !important; color:blue !important; background-color:transparent !important; }
-
To match the processing instructions, you can use the
oxy|processing-instruction
selector:oxy|processing-instruction { display:block !important; color:purple !important; background-color:transparent !important; }
A processing instruction usually has a target and one or more pseudo attributes:
<?target_name data="b"?>
You can match a processing instruction with a particular target from the CSS using the construct:oxy|processing-instruction[target_name]
You can also match the processing instructions having a certain target and pseudo attribute value, such as:oxy|processing-instruction[target_name][data="b"]
- The XML comments display in Author mode can be changed using the
oxy|comment
selector:oxy|comment { display:block !important; color:green !important; background-color:transparent !important; }
- The
oxy|cdata
selector matches CDATA sections:oxy|cdata{ display:block !important; color:gray !important; background-color:transparent !important; }
- The
oxy|entity
selector matches the entities content:oxy|entity { display:morph !important; editable:false !important; color:orange !important; background-color:transparent !important; }
To match particular entities, use theoxy|entity
selector in expressions such as:oxy|entity[name='amp'], oxy|entity[name='lt'], oxy|entity[name='gt'], oxy|entity[name='quot'], oxy|entity[name='apos'], oxy|entity[name^='#']{ -oxy-display-tags: none; }
- The references to entities, XInclude, and DITA
conrefs and conkeyrefs are expanded by default in
Author mode and the referenced content is displayed. The referenced
resources are displayed inside the element or entity that refers to them.
-
You can use the
reference
property to customize the way these references are rendered in Author mode:oxy|reference { border:1px solid gray !important; }
In the Author mode, content is highlighted when text contains comments and changes (if Track Changes was active when the content was modified).
If this content is referenced, the Author mode does not display the highlighted areas in the new context. If you want to mark the existence of this comments and changes you can use the
oxy|reference[comments]
,oxy|reference[changeTracking]
, andoxy|reference[changeTracking][comments]
selectors.Note
Two artificial attributes (comments
andchangeTracking
) are set on the reference node, containing information about the number of comments and track changes in the content.-
The following example represents the customization of the reference fragments that contain comments:
oxy|reference[comments]:before { content: "Comments: " attr(comments) !important; }
-
To match reference fragments based on the fact that they contain change tracking inside, use the
oxy|reference[changeTracking]
selector.oxy|reference[changeTracking]:before { content: "Change tracking: " attr(changeTracking) !important; }
-
Here is an example of how you can set a custom color to the reference containing both track changes and comments:
oxy|reference[changeTracking][comments]:before { content: "Change tracking: " attr(changeTracking) " and comments: " attr(comments) !important; }
-