-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XmlDataProcessor unable to convert data to xml #1275
Comments
Hello, So xmlDataProcessor could be :
Is the resolution of this issue could be planed ? Thx |
Hello, first of all, I'd like to apologize for the late response, somehow we've missed this ticket. Indeed, the problem exists and our @vdeygas, pull request with a fix for this case (with tests and documentation) will be much appreciated and we will be more than happy to review it. |
I stumbled on this problem recently, where the prospect reported that our XML processor returns The problem is with the fact that we're simply using basic (HTML) writer for XML. Using a XML writer will improve it. I made a PoC like that:
By adding the
Which produces proper markup for self closing tags, but adds namespace URL for top level elements. |
There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may be relevant, so if you're interested in the solution, leave a comment or reaction under this issue. |
We've closed your issue due to inactivity over the last year. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it). |
Is this a bug report or feature request? (choose one)
🐞 Bug report
XmlDataProcessor is unable to convert data to xml. (Importing existing xml does work).
This can bee seen in 2 ways: The easy is just to do:
editor.data.processor=new XmlDataProcessor();
console.log(editor.getData());
which returns html instead of xml. The exact same thing happens if I create my own XmlDataProcessor instance and calls toData()
💻 Version of CKEditor
Cke version:
"@ckeditor/ckeditor5-core": {
"version": "11.0.0",
}
It's a bug i standard CKEditor without any plugins.
📋 Steps to reproduce
Either Just do:
editor.data.processor=new XmlDataProcessor();
console.log(editor.getData())
or
execute this plugin:
class MtExampleCommand extends Command {
execute() {
const editor=this.editor;
const model=editor.model;
const modelDocument = editor.model.document;
const view = editor.editing.view;
const viewDocument = view.document;
const p=new XmlDataProcessor();
const vRoot=viewDocument.getRoot();
const xml=p.toData(vRoot);
}
}
✅ Expected result
Valid xml.
❎ Actual result
Valid html (tags such as img not closed. attributes values and & are not escaped.
📃 Other details that might be useful
The XmlDataProcessor.toData() method which should convert to xml just does this:
So it looks like the method to convert to xml newer got a real implementation.
The text was updated successfully, but these errors were encountered: