Page 1 of 1

Join the splitted element

Posted: Tue Mar 21, 2023 12:22 pm
by shilpa
Hi Team,

I have splitted the element using documentcCntroller.split(). Now i want to join back the elements to its initial position how to achieve it?

Example :
1. <label.designator>FN</label.designator>

after split it becomes
<label.designator>F</label.designator><label.designator>N</label.designator>

now i want to join it back as
<label.designator>FN</label.designator>

Please let us know is there any existing method for the same?


Regards
Shilpa.P

Re: Join the splitted element

Posted: Tue Mar 21, 2023 5:26 pm
by mihaela
Hello,

There is no direct method to join the elements but you can use other methods from AuthorDocumentController to obtain this. For example:
- ro.sync.ecss.extensions.api.AuthorDocumentController.createDocumentFragment(int, int) to get the content from the second node as AuthorDocumentFragment
- ro.sync.ecss.extensions.api.AuthorDocumentController.serializeFragmentToXML(AuthorDocumentFragment) to get the content from the first step as String
- ro.sync.ecss.extensions.api.AuthorDocumentController.deleteNode(AuthorNode) to delete the second node
- ro.sync.ecss.extensions.api.AuthorDocumentController.insertXMLFragment(String, int) to insert the content fragment obtained at step two inside the first node.

Best Regards,
Mihaela