Elements to be highlighted in the document

Having trouble installing Oxygen? Got a bug to report? Post it all here.
shilpa
Posts: 68
Joined: Mon Jul 04, 2022 8:42 am

Elements to be highlighted in the document

Post by shilpa »

Hi Oxygen Team,
I have list of Xpath of locations. When i click on xpath location particular element should be highlighted in the document in web author.
Below is the example of xpath location. Here headext element should get highlighted.
XPath location: /n-load[1]/n-document[1]/n-docbody[1]/current.related.matter[1]/related.documents[1]/head[1]/headtext[1]

Please do the needful.
mihaela
Posts: 515
Joined: Wed May 20, 2009 2:40 pm

Re: Elements to be highlighted in the document

Post by mihaela »

Hello,

When the user clicks on the XPath you can invoke a custom Author operation that finds the node indicated by the XPath using the AuthorDocumentController.findNodesByXPath API and then adds a highlight on it, using the AuthorHighlighter API.

We also have a sample plugin that adds non persistent highlights on each paragraph, that you can use as a starting point:
https://github.com/oxygenxml/web-author ... highlights

Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
shilpa
Posts: 68
Joined: Mon Jul 04, 2022 8:42 am

Re: Elements to be highlighted in the document

Post by shilpa »

Thank you Mihaela.. It is working fine.
mihaela
Posts: 515
Joined: Wed May 20, 2009 2:40 pm

Re: Elements to be highlighted in the document

Post by mihaela »

Hello,

We are glad that you implemented the elements highlighting.
Please let us know if you need further assistance.

Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
Post Reply