#1078 CDATA in xml documents is not correctly closed

Bug
open
Neil Hodgson
Scintilla (791)
2
2010-12-23
2010-12-21
Alex Netkachov
No

Here is a sample XML:

<x:stylesheet xmlns:x="http://www.w3.org/1999/XSL/Transform" version="1.0">
<x:template match="1">
<x:if test="2">
<![CDATA[
<?php
return ob_get_clean();
}]]>
</x:if>
<x:if test="3">
<![CDATA[
<?php
return ob_get_clean();
}]]>
</x:if>
</x:template>
</x:stylesheet>

And I've attached the SciTE image that shows formatting: as you can se, it is wrong.

Discussion

  • Alex Netkachov
    Alex Netkachov
    2010-12-21

    Wrong formatting demo

     
    Attachments
  • Alex Netkachov
    Alex Netkachov
    2010-12-21

    • priority: 5 --> 6
     
  • Neil Hodgson
    Neil Hodgson
    2010-12-23

    It is unclear what you want here since your PHP sections are not terminated. I will not be working on this.

    The priority field on tracker issues is for use by maintainers and should not be set by reporters.

     
  • Neil Hodgson
    Neil Hodgson
    2010-12-23

    • assigned_to: nobody --> nyamatongwe
    • priority: 6 --> 2
     
  • Alex Netkachov
    Alex Netkachov
    2010-12-23

    > It is unclear what you want here since your PHP sections are not
    terminated. I will not be working on this.

    If the file extension is PHP then PHP syntax takes precedence. But this is XSL/XML file (with xsl extension) so the XML syntax is high priority here.

     
  • ybungalobill
    ybungalobill
    2012-10-01

    > ... so the XML syntax is high priority here.

    Exactly. The above code is a well-formed XML, and from XML's point of view the `<?` character sequence inside a CDATA block shall not be interpreted as a processing instruction. Whether <?php is closed or not is irrelevant here. The same problem can be seen in the following code:

    <a><![CDATA[ <? ]]></a>

    being a valid XML, the syntax highlighting stops at the <?, although it should not.