Highlight

  • 4 replies.
  • This is not yet resolved.
  • This question was started by Max.
  • Last post by Fredrik.
Max
user
August 26th 2010
how to highlight the selected content in the xml of Xopus?
Max
user
August 26th 2010
I want to change the background of selected content.
The selected content is part of a xml element;
and maybe the selected content span two xml element.
At last ,I want to save the Highlight.
Fredrik
member
August 26th 2010
Hi Max,
You might want to check out this article:
http://xopus.com/devblog/2009/highlighting-the-current-context-element.html
Is that what you are trying to achieve?
Max
user
August 27th 2010
Hello Fredrik,
I tried this example,but the effect was not that I want to achieve.
I want to change the background of selected content.
The selected content is part of a xml element;
and maybe the selected content span two xml element.
At last ,I want to save the changed background.
Fredrik
member
August 27th 2010
If you want to save it, it must have some representation in the xml file, for example as elements. Then you would have to edit your xslt to render these elements with a different background.

To apply these elements, you can make a selection, either a small portion of an element or a selection that spans more elements, and when you apply it several elements are created, one for each parent element.

To create such a highlight, you would have to make a button that loops through the selection and creates the elements where needed, look at http://xopus.com/documentation/api/dom/xopusrange.html for a starting point on how to do this.

React

HTML will be shown as HTML code.
Linebreaks and Links starting with http:// are automatically resolved