Insert with Schema Aware behavior issue
Posted: Wed Mar 09, 2022 5:28 pm
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.