Completed
Last Updated: 15 Feb 2021 10:57 by ADMIN
Release R1 2021 SP2
Mi
Created on: 10 Dec 2020 08:28
Category: SyntaxEditor
Type: Bug Report
0
RadSyntaxEditor: Character data sections are not recognized by XmlTagger

If my xml string contains an element with attributes, XMLFoldingTagger just ignores it!

 

For example:

<Formular DebugMode="F" Version="1" Typ="Rechnung">

     <OtherElements/>

<Formular/>

 

is ignored. Element Formular is not recognized by the XMLFoldingTagger. Only simple elements are recognized, like:

 

<Formular>

     <OtherElements/>

<Formular/>

 

 

3 comments
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 11 Dec 2020 13:01

Hello, Mi,    

The provided code snippet is greatly appreciated. I was able to observe the described behavior:

Notepad++:

I confirm that this is an issue with the current parsing logic in the XmlFoldingTagger. I have approved this bug report.

I have also updated your Telerik points.

Currently, the possible solution that I can suggest is to add a closing tag ("</") for the CDATA:

Thus, the FirstElement will be foldable.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Mi
Posted on: 10 Dec 2020 09:05

I made a small example which shows the real problem. The Problem is XMLFoldingTagger has problems with CDATA:

 

        public RadForm1()
        {
            InitializeComponent();

            XmlDocument xml = new XmlDocument();
            xml.PreserveWhitespace = true;
            xml.LoadXml("<FirstElement>\r\n  <OtherElements>\r\n    <![CDATA[]]>\r\n  </OtherElements>\r\n</FirstElement>");

            this.radSyntaxEditor1.Document = new TextDocument(xml.OuterXml);

            XmlTagger xmlTagger = new XmlTagger(this.radSyntaxEditor1.SyntaxEditorElement);
            XmlFoldingTagger xmlFoldingTagger = new XmlFoldingTagger(this.radSyntaxEditor1.SyntaxEditorElement);
            this.radSyntaxEditor1.TaggersRegistry.RegisterTagger(xmlTagger);
            this.radSyntaxEditor1.TaggersRegistry.RegisterTagger(xmlFoldingTagger);

        }

If you run this sample, FirstElement is not foldable. If you remove the CDATA-entry it is.

Mi
Posted on: 10 Dec 2020 08:49

Sorry for posting too fast, the title should be changed to:

XMLFoldingTagger doesn't recognizes elements with attributs, when a CDATA is used in a child element

In my example OtherElements should be replaced with

<OtherElements>
<![CDATA[]]>
</OtherElements>


I think CDATA is the thing which breaks XMLFoldingTagger.