InsertXMLFragmentSchemaAware questions
Posted: Thu Aug 17, 2023 10:21 am
Hello,
I use Author web 25.1.0.0.
I've created a button to add a specific fragment at the cursor position.
Since I want the insertion of the fragment to be valid, I have several possible approaches:
- initially disable the button when insertion at the cursor will cause a validation error thanks to :
- use the insertXMLFragmentSchemaAware method to ensure that the fragment is positioned in a valid location.
My questions concern the 2nd way.
In the javadoc, for the method insertXMLFragmentSchemaAware it is specified :
Before the fragment is inserted using the insertXMLFragmentSchemaAware method, would it be possible to warn the user of the location (xpath for example) where the fragment is about to be inserted? In fact, I'd like to be able to ask the user to confirm the automatic location found by Oxygen (SchemaAwareHandlerResult schemaAwareHandlerResult) without the fragment being inserted yet.
Thank you,
Johann
I use Author web 25.1.0.0.
I've created a button to add a specific fragment at the cursor position.
Since I want the insertion of the fragment to be valid, I have several possible approaches:
- initially disable the button when insertion at the cursor will cause a validation error thanks to :
Code: Select all
authorSchemaManager.createWhatElementsCanGoHereContext(caretOffset)
My questions concern the 2nd way.
In the javadoc, for the method insertXMLFragmentSchemaAware it is specified :
However, I don't see any dialog allowing me to choose the location, the fragment is automatically inserted in a valid location. Is this normal?If the fragments insertion is not allowed, a dialog will be shown proposing one of following solutions if they apply:
Before the fragment is inserted using the insertXMLFragmentSchemaAware method, would it be possible to warn the user of the location (xpath for example) where the fragment is about to be inserted? In fact, I'd like to be able to ask the user to confirm the automatic location found by Oxygen (SchemaAwareHandlerResult schemaAwareHandlerResult) without the fragment being inserted yet.
Thank you,
Johann