How to use following kind of tag to add or rename tag

Having trouble installing Oxygen? Got a bug to report? Post it all here.
SmitaPatil
Posts: 93
Joined: Mon Aug 08, 2022 2:32 pm

How to use following kind of tag to add or rename tag

Post by SmitaPatil »

Hi Team,
I want to add tag such as <?Pub Caret 44?> and <?Pub _link?> <?Pub /_link?> in document.
I tried to use surroundInFragment method but its not working.
Just wanted to check if there is any way to tag this kind of tag.

Thanks,
Smita
mihaela
Posts: 515
Joined: Wed May 20, 2009 2:40 pm

Re: How to use following kind of tag to add or rename tag

Post by mihaela »

Hello,

In general to insert an XML fragment you should use the API:ro.sync.ecss.extensions.api.AuthorDocumentController.insertXMLFragment(String, int).

For example, let's say that you want to insert the first processing instruction at caret offset. This is the sample code:

Code: Select all

String myFragment = "<?Pub Caret 44?>";
authorAccess.getDocumentController().insertXMLFragment(myFragment, authorAccess.getEditorAccess().getCaretOffset());
Please let us know if this is not right for your use case and you need more information.

Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
SmitaPatil
Posts: 93
Joined: Mon Aug 08, 2022 2:32 pm

Re: How to use following kind of tag to add or rename tag

Post by SmitaPatil »

Hi Mihaela,
Thank you.
Can you please tell the method using which we can just remove tag name without removing text inside it or any method using which we can replace tag name by processing instruction.

Thanks,
Smita
mihaela
Posts: 515
Joined: Wed May 20, 2009 2:40 pm

Re: How to use following kind of tag to add or rename tag

Post by mihaela »

Hi Smita,

There is an API method that you can use to remove the tags of an element: ro.sync.ecss.extensions.commons.operations.CommonsOperationsUtil.unwrapTags(AuthorAccess, AuthorNode).
Then, to add the processing instructions just use the ro.sync.ecss.extensions.api.AuthorDocumentController.insertXMLFragment(String, int) method that I mentioned in my previous message.

Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
SmitaPatil
Posts: 93
Joined: Mon Aug 08, 2022 2:32 pm

Re: How to use following kind of tag to add or rename tag

Post by SmitaPatil »

Hi Mihaela,
Thank you so much.
Can you please provide documentation link on handling Processing instruction in oxygen xml editor and web author .
it will be helpful.

Thanks,
Smita
mihaela
Posts: 515
Joined: Wed May 20, 2009 2:40 pm

Re: How to use following kind of tag to add or rename tag

Post by mihaela »

Hi Smita,

Can you please give us more details about what do you mean by "handling Processing instruction"?

Here are some documentation links:
1. Oxygen XML Editor 24.1 User Guide
https://www.oxygenxml.com/doc/versions/24.1/ug-editor/

2. Oxygen XML Web Author 24.1 User Guide
https://www.oxygenxml.com/doc/versions/ ... webauthor/

3. Oxygen Web Author 24.1 Customization Guide
https://www.oxygenxml.com/doc/versions/ ... -waCustom/

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