[oXygen-user] Highlighting text between processing instructions.

Oxygen XML Editor Support support at oxygenxml.com
Mon Dec 3 06:26:27 CST 2012


Hi Anthony,

Please see some answers below:

> However, I have been unable to find a technique that allows the nodes between a <?oxy_custom_start?> and <?oxy_custom_end?> processing instruction to be accessed via CSS, rather than the AuthorPersistentHighlighter API. Is this possible?

This is not possible because the CSS matches hierarchical structures and 
having two start-end processing instructions in certain parts of the 
documents does not automatically determine such a hierarchy.

> The problem with the element based approach is that this requires non-DITA (or other format specific doctype) elements to represent the additional information that we want to process. We would prefer to use processing instructions to contain this additional information, as this would not break the DITA validation.

I agree.

> Ideally, we would like to be able to use the form based editing functionality with processing instructions (PIs), whilst the PIs are still hidden from view.
> Is it possible to 'link' a StyleFilter to the form based editing functionality through the API?

I do not fully understand.
 From a StylesFilter you can specify that a certain element should be 
edited using a certain form-based control.
Something like:

>     List<ro.sync.ecss.css.StaticContent> content = new ArrayList<StaticContent>();
>     Map<String, Object> props = new HashMap<String, Object>();
>     props.put(InplaceEditorCSSConstants.PROPERTY_TYPE, InplaceEditorCSSConstants.TYPE_POPUP_SELECTION);
>     props.put(InplaceEditorCSSConstants.PROPERTY_EDIT, "@attrName");
>     //Set single selection.
>     props.put(InplaceEditorCSSConstants.PROPERTY_SELECTION_MODE, InplaceEditorCSSConstants.SELECTION_MODE_SINGLE);
>     props.put(InplaceEditorCSSConstants.PROPERTY_RENDERER_SEPARATOR, ",");
>     props.put(InplaceEditorCSSConstants.PROPERTY_RENDERER_SORT, InplaceEditorCSSConstants.SORT_ASCENDING);
>     props.put(InplaceEditorCSSConstants.PROPERTY_FONT_INHERIT, InplaceEditorCSSConstants.TRUE);
>     props.put(InplaceEditorCSSConstants.PROPERTY_VALUES,
>         //The list of allowed values separated by ", " or set nothing if you want values to come from the schema
>         valuesList.toString());
>     props.put(InplaceEditorCSSConstants.PROPERTY_TOOLTIPS,
>         //A tooltip for each value, separated by ", "
>         tooltipsList.toString());
>     props.put(InplaceEditorCSSConstants.PROPERTY_SEPARATOR, " ");
>     content.add(new StringContent("["));
>     //The editor will be placed here
>     content.add(new EditorContent(props));
>     content.add(new StringContent("]"));
>     styles.setProperty(Styles.KEY_MIXED_CONTENT, content);

So if in the StylesFilter you decide that for a certain element there 
are two start and end PIs before and after it you can add a form control 
on it from the Java code.

Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 11/30/2012 6:37 PM, Michael Anthony Smith wrote:
> Hi, I have read several previous posts on this topic, but still have
> some questions.
>
> Previous topics:
> http://www.oxygenxml.com/forum/topic4909.html
> http://www.oxygenxml.com/forum/topic6949.html
> http://www.oxygenxml.com/forum/topic7103.html
>
> Using oXygen 14.1: I am able to write a custom StylesFilter that
> appropriately adjusts the colour highlighting of elements near
> processing instructions. I am also able to use the CSS form based
> editing (oxy_editor) to provide formatting and selection lists for
> elements. However, I have been unable to find a technique that allows
> the nodes between a <?oxy_custom_start?> and <?oxy_custom_end?>
> processing instruction to be accessed via CSS, rather than the
> AuthorPersistentHighlighter API. Is this possible?
>
> The problem with the element based approach is that this requires
> non-DITA (or other format specific doctype) elements to represent the
> additional information that we want to process. We would prefer to use
> processing instructions to contain this additional information, as this
> would not break the DITA validation.
>
> Ideally, we would like to be able to use the form based editing
> functionality with processing instructions (PIs), whilst the PIs are
> still hidden from view. Is it possible to 'link' a StyleFilter to the
> form based editing functionality through the API?
>
> Any suggestions welcome.
>
> Best regards.
> Anthony.
> --
> -- -------------------------------------------------------------------------
> Michael Anthony Smith, DeltaXML Ltd "Michael Anthony Smith, DeltaXML Ltd
> "Experts in Information Change""
> T: +44 1684 869035   E: anthony.smith at deltaxml.com
> <mailto:anthony.smith at deltaxml.com> http://www.deltaxml.com
> <http://www.deltaxml.com/>
> Registered in England 02528681 Reg. Office: Monsell House, WR8 0QN, UK
>
>
>
> _______________________________________________
> oXygen-user mailing list
> oXygen-user at oxygenxml.com
> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
>


More information about the oXygen-user mailing list