surroundFragmentOperation with schemaaware flag set to true is not working as expected.
Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
-
- Posts: 99
- Joined: Fri Jul 01, 2022 12:08 pm
surroundFragmentOperation with schemaaware flag set to true is not working as expected.
Post by shikhar_472 »
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.
-
- Posts: 515
- Joined: Wed May 20, 2009 2:40 pm
Re: surroundFragmentOperation with schemaaware flag set to true is not working as expected.
Hi,
The schemaAware argument of the SurroundWithFragmentOperation applies only when there is no selection in the document (in this case the fragment is inserted at caret position).
If there is a selection in the document, the schemaAware argument is not taken into account:
https://www.oxygenxml.com/InstData/Edit ... ation.html
Best Regards,
Mihaela
The schemaAware argument of the SurroundWithFragmentOperation applies only when there is no selection in the document (in this case the fragment is inserted at caret position).
If there is a selection in the document, the schemaAware argument is not taken into account:
https://www.oxygenxml.com/InstData/Edit ... ation.html
Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
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