Check if an element is allowed without inserting
Oxygen general issues.
-
- Posts: 52
- Joined: Thu Dec 15, 2011 7:56 pm
Check if an element is allowed without inserting
Hi,
We have some buttons which aim to insert new elements in the XML tree.
We would like to "setEnable" those buttons only when it is allowed by the schema.
In fact we would like to test an xml fragment at the caret position in order to know if we can insert it or not (true/false). But without having to add it in the XML tree (this step will depend on if the user will click or not)
Thank you,
Vincent.
We have some buttons which aim to insert new elements in the XML tree.
We would like to "setEnable" those buttons only when it is allowed by the schema.
In fact we would like to test an xml fragment at the caret position in order to know if we can insert it or not (true/false). But without having to add it in the XML tree (this step will depend on if the user will click or not)
Thank you,
Vincent.
-
- Posts: 9445
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Check if an element is allowed without inserting
Hi Vincent,
In Oxygen 14.2 these expressions will also be used to disable the actions if the XPath activation expression is not triggered in the current context.
which has methods like:
You can create an AuthorDocumentFragment from an XML string like:
Regards,
Radu
If the buttons are implemented as Author actions, they have XPath activation expressions.We have some buttons which aim to insert new elements in the XML tree.
We would like to "setEnable" those buttons only when it is allowed by the schema..
In Oxygen 14.2 these expressions will also be used to disable the actions if the XPath activation expression is not triggered in the current context.
There is an AuthorSchemaManager:In fact we would like to test an xml fragment at the caret position in order to know if we can insert it or not (true/false).
Code: Select all
AuthorSchemaManager authorSchemaManager = authorAccess.getDocumentController().getAuthorSchemaManager();
Code: Select all
ro.sync.ecss.extensions.api.AuthorSchemaManager.canInsertDocumentFragment(AuthorDocumentFragment, int, short)
Code: Select all
ro.sync.ecss.extensions.api.AuthorDocumentController.createNewDocumentFragmentInContext(String, int)
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)
- ↳ 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