Page 1 of 1

Elements to be highlighted in the document

Posted: Thu Jul 14, 2022 1:05 pm
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.

Re: Elements to be highlighted in the document

Posted: Thu Jul 14, 2022 2:16 pm
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

Re: Elements to be highlighted in the document

Posted: Tue Jul 19, 2022 12:22 pm
by shilpa
Thank you Mihaela.. It is working fine.

Re: Elements to be highlighted in the document

Posted: Tue Jul 19, 2022 2:10 pm
by mihaela
Hello,

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

Best Regards,
Mihaela