Split_element function
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 16
- Joined: Mon Mar 18, 2013 6:29 pm
Split_element function
Hi,
I use the split_element function in a paragraph but it does not work inside a bold or italics text:
here is my java code:
Best Regards,
Idak,
I use the split_element function in a paragraph but it does not work inside a bold or italics text:
Code: Select all
<p>text text text text text <i><b>text (caret position) text text</b><i> text text </p>
Code: Select all
if ("p".equals(paragraphAtCaret.getName())
|| ("b".equals(paragraphAtCaret.getName()) && "p".equals(paragraphAtCaret.getParent().getName()))
|| ("i".equals(paragraphAtCaret.getName()) && "p".equals(paragraphAtCaret.getParent().getName()))
|| ("sup".equals(paragraphAtCaret.getName()) && "p".equals(paragraphAtCaret.getParent().getName()))) {
Object action = authorAccess.getEditorAccess().getActionsProvider()
.getAuthorCommonActions().get("XML_Refactoring/Split_element");
authorAccess.getEditorAccess().getActionsProvider().invokeAction(action);
}
Idak,
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Split_element function
Post by alex_jitianu »
Hello,
At first glance the problem seems to be related with the if statement. In the XML snapshot that you sent, the caret is in a b element from an i element. The if statement allows only the case when the b element is inside a p.
If the node at caret is b, i, sup you should look into the ancestors of the node at caret for a p element.
Best regards,
Alex
At first glance the problem seems to be related with the if statement. In the XML snapshot that you sent, the caret is in a b element from an i element. The if statement allows only the case when the b element is inside a p.
If the node at caret is b, i, sup you should look into the ancestors of the node at caret for a p element.
Best regards,
Alex
-
- Posts: 16
- Joined: Mon Mar 18, 2013 6:29 pm
Re: Split_element function
Hello Alex,
I change the if predicate but when use the the split element inside bold or italic tag it does not split a paragraph tag:
before split :
After split:
I want have this result:
Thanks,
I change the if predicate but when use the the split element inside bold or italic tag it does not split a paragraph tag:
before split :
Code: Select all
<p>text text text text <b>text (caret position) bold</b> text text text text </p>
Code: Select all
<p>text text text text <b>text (caret position)</b><b> bold</b> text text text text </p>
Code: Select all
<p>text text text text <b>text (caret position)</b></p><p><b> bold</b> text text text text </p>
-
- Posts: 9449
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Split_element function
Hi,
The "Split" action you are using splits the current element located at the current position, the b element in your case. This is all it does, it is not equivalent to the Split action performed when you press ENTER in a paragraph.
But you have enough API to implement such an operation yourself:
http://www.oxygenxml.com/forum/post21668.html#p21668
Regards,
Radu
The "Split" action you are using splits the current element located at the current position, the b element in your case. This is all it does, it is not equivalent to the Split action performed when you press ENTER in a paragraph.
But you have enough API to implement such an operation yourself:
http://www.oxygenxml.com/forum/post21668.html#p21668
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service