Insert with Schema Aware behavior issue
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 168
- Joined: Fri Jan 20, 2017 1:11 pm
Insert with Schema Aware behavior issue
Hello,
We work with Oxygen SDK 24.0.0.2
We want to insert element (String fragment or AuthorDocumentFragment) with the following method
Sometimes it inserted well in the good node but sometimes, it looks to the siblings and insert the new fragment in other node, which it is not what we asked for.
Is it possible to force the schema aware to insert at caret position, no matters siblings ?
We want to keep the notion of schema aware to secure our fragment insertion and drag & drop.
But the curent behavior is actually not efficient for us, as we can not garante where the fragment will be inserted.
Otherwise is there a way for us to simulate schema aware notion ?
For exemple, I want to insert the element <picture/> into the element <topic/>
but the element <topic/> has the following structure :
I tried to build something with AuthorSchemaManager interface, with whatElementsCanGoHere and getElementToParentsMap methods,
to generate a new fragment <topicContent><picture/></topicContent>
and then insert it without schemareAware, but it is really complicated.
Thanks for any help.
Regards.
We work with Oxygen SDK 24.0.0.2
We want to insert element (String fragment or AuthorDocumentFragment) with the following method
But the result is not efficient.insertFragmentSchemaAware(int insertOffset, AuthorDocumentFragment frag)
insertXMLFragmentSchemaAware(java.lang.String xmlFragment, int offset)
insertXMLFragmentSchemaAware(java.lang.String xmlFragment, int offset, boolean replaceSelection)
insertXMLFragmentSchemaAware(java.lang.String xmlFragment, int offset, int actionID, boolean replaceSelection)
insertXMLFragmentSchemaAware(java.lang.String xmlFragment, java.lang.String xpathLocation, java.lang.String relativePosition)
insertXMLFragmentSchemaAware(java.lang.String xmlFragment, java.lang.String xpathLocation, java.lang.String relativePosition, boolean insertEvenIfInvalid)
Sometimes it inserted well in the good node but sometimes, it looks to the siblings and insert the new fragment in other node, which it is not what we asked for.
Is it possible to force the schema aware to insert at caret position, no matters siblings ?
We want to keep the notion of schema aware to secure our fragment insertion and drag & drop.
But the curent behavior is actually not efficient for us, as we can not garante where the fragment will be inserted.
Otherwise is there a way for us to simulate schema aware notion ?
For exemple, I want to insert the element <picture/> into the element <topic/>
but the element <topic/> has the following structure :
Code: Select all
<topic>
<topicContent>
<picture/>
</topicContent>
</topic>
to generate a new fragment <topicContent><picture/></topicContent>
and then insert it without schemareAware, but it is really complicated.
Thanks for any help.
Regards.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Insert with Schema Aware behavior issue
Hi Isabelle,
You should try to make a precise list of cases when the schema aware insertion does not do what you want, it would be useful for you and if you share with us a sample xml + schema and the list of situations maybe we could also work to improve the behavior.
Regards,
Radu
The schema aware insertion strategies were created to work over any XML document as long as a schema is provided for it, it may be possible that for particular xml + schema situations for it to not produce exactly what you want.But the result is not efficient.
If you give us a small XML + schema sample and precise steps to reproduce the problem maybe we can improve the current functionality.Sometimes it inserted well in the good node but sometimes, it looks to the siblings and insert the new fragment in other node, which it is not what we asked for.
Well if you want to force insertion at the caret position, you can just plain insert, without schema ware.Is it possible to force the schema aware to insert at caret position, no matters siblings ?
The schema aware insertion behavior is not random, at a certain offset in the XML it will always have a certain behavior.We want to keep the notion of schema aware to secure our fragment insertion and drag & drop.
But the curent behavior is actually not efficient for us, as we can not garante where the fragment will be inserted.
This would have been also my proposed workaround, use Oxygen's AuthorSchemaManager API to detect what elements are available at a certain offset and change (at least in some situations) how the content should be inserted. It should be not that difficult if you identity only the situations where you want to take control and for all others keep inserting schema aware.Otherwise is there a way for us to simulate schema aware notion ?
For exemple, I want to insert the element <picture/> into the element <topic/>
but the element <topic/> has the following structure :
.......
I tried to build something with AuthorSchemaManager interface, with whatElementsCanGoHere and getElementToParentsMap methods,
to generate a new fragment <topicContent><picture/></topicContent>
and then insert it without schemareAware, but it is really complicated.
You should try to make a precise list of cases when the schema aware insertion does not do what you want, it would be useful for you and if you share with us a sample xml + schema and the list of situations maybe we could also work to improve the behavior.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Insert with Schema Aware behavior issue
Hi Isabell,
You can send us a zip via email (support@oxygenxml.com) if it is small or use our tech support form to attach a larger zip file: https://www.oxygenxml.com/technical_support_policy.html
Regards,
Radu
You can send us a zip via email (support@oxygenxml.com) if it is small or use our tech support form to attach a larger zip file: https://www.oxygenxml.com/technical_support_policy.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
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