Page 1 of 1
Get Full tag
Posted: Fri Jul 08, 2022 1:20 pm
by shilpa
Hi Team,
In my code i am getting nodes by FindNodesByXpath("/headtext");
Here i am not getting full tag attributes instead i am getting <headtext align="center" ,> (337, 349).
I need entire tags and attributes with values. Example is given below.
Please do the needful.
Example :
<headtext align="centre">Syllabus<headtext>
Re: Get Full tag
Posted: Fri Jul 08, 2022 3:02 pm
by mihaela
Hello,
Can you please give us more details about the code you are referring to and what you are trying to obtain?
Do you use the
AuthorDocumentController.findNodesByXPath(String, boolean, boolean, boolean) API?
If this is the case, the result is a list of
AuthorNodes that contain information about the start and end offsets of the node (see
AuthorNode.getStartOffset() and
AuthorNode.getEndOffset() methods).
Best Regards,
Mihaela
Re: Get Full tag
Posted: Mon Jul 11, 2022 8:33 am
by shilpa
Hi Mihaela,
Thank you for the response. Yes i use AuthorDocumentController.findNodesByXPath(String, boolean, boolean, boolean) and the result is a list of AuthorNodes.
My requirement is to display the node. So when i iterate the list and display the data i am getting node as <headtext align="center" ,> (337, 349).
But i need node as <headtext align="centre">xyz<headtext>.
My question is how to get full node like <headtext align="centre">xyz<headtext>.
Re: Get Full tag
Posted: Mon Jul 11, 2022 9:07 am
by mihaela
Hello,
The API that you need to obtain the XML representation of an
AuthorNode is:
- AuthorDocumentController.createDocumentFragment(AuthorNode, boolean) to obtain the AuthorDocumentFragment corresponding to the node
- AuthorDocumentController.serializeFragmentToXML(AuthorDocumentFragment) to obtain the XML text corresponding to a given AuthorDocumentFragment.
Please let us know if you need more information.
Best Regards,
Mihaela
Re: Get Full tag
Posted: Mon Jul 11, 2022 2:00 pm
by shilpa
Now i am able to see xml full tag now. Thank you so much for the help Mihaela.
Re: Get Full tag
Posted: Mon Jul 11, 2022 2:46 pm
by mihaela
Hi,
We are happy that we helped you.
Please let us know if you need further assistance.
Best Regards,
Mihaela