surroundFragmentOperation with schemaaware flag set to true is not working as expected.
Posted: Fri Jul 01, 2022 1:13 pm
Hi Oxygen Team,
We found the issue with surroundFragmentOperation with schemaaware flag set to true, below is the scenario-
Valid xml as per the xsd would look like
<document>
<title>
<format>
<bold></bold>
<italic></italic>
<underline></underline>
</format>
</title>
</document>
in our example xml looks like below-
<document>
<title>
<bold></bold>
<italic></italic>
<underline></underline>
</title>
</document>
Here our user selects content/xml-elements inside <title> and invokes format operation and we are using surroundFragmentOperation to wrap selected content within the format tag.
But when users selects entire <title> tag including the tag boundaries and invokes format operation we observed the <title> tag itself being wrapped inside <format> tag,
which is not valid as per schema.
surroundFragmentOperation should be able to identify that this is not a valid operation and throw error.
Can you please help us on this scenario.
We are calling surroundFragmentOperation within a plugin like below.
this.editor.getActionsManager().invokeOperation(
'ro.sync.ecss.extensions.commons.operations.SurroundWithFragmentOperation', {
fragment: '<format xmlns="http://www.example.com/article"></format>',
schemaAware: 'true'
});
Thanks,
Shikhar.
We found the issue with surroundFragmentOperation with schemaaware flag set to true, below is the scenario-
Valid xml as per the xsd would look like
<document>
<title>
<format>
<bold></bold>
<italic></italic>
<underline></underline>
</format>
</title>
</document>
in our example xml looks like below-
<document>
<title>
<bold></bold>
<italic></italic>
<underline></underline>
</title>
</document>
Here our user selects content/xml-elements inside <title> and invokes format operation and we are using surroundFragmentOperation to wrap selected content within the format tag.
But when users selects entire <title> tag including the tag boundaries and invokes format operation we observed the <title> tag itself being wrapped inside <format> tag,
which is not valid as per schema.
surroundFragmentOperation should be able to identify that this is not a valid operation and throw error.
Can you please help us on this scenario.
We are calling surroundFragmentOperation within a plugin like below.
this.editor.getActionsManager().invokeOperation(
'ro.sync.ecss.extensions.commons.operations.SurroundWithFragmentOperation', {
fragment: '<format xmlns="http://www.example.com/article"></format>',
schemaAware: 'true'
});
Thanks,
Shikhar.