Menu

#1078 CDATA in xml documents is not correctly closed

Bug
closed-fixed
2
2024-07-22
2010-12-21
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

     
  • 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.

     
  • Menno Vogels

    Menno Vogels - 2017-02-14

    Kind bump as still an issue in 2017 (see Notepad++ issue 2898).

    Can be reproduced with:
    - Notepad++ v7.3.2 using Scintilla v3.7.2;
    - SCiTE v3.7.2.

     
  • Gérson Vagner

    Gérson Vagner - 2017-11-25

    It will complete 10 (ten) years in the next month that the issue was raised and I continue to see the same problem in NotePad++. See Notepad++ issue 2898.

    Reproduced with:
    -Notepad++ v.7.5.1

     
  • Zufu Liu

    Zufu Liu - 2022-04-09
    • labels: Scintilla --> Scintilla, xml
     
  • Zufu Liu

    Zufu Liu - 2022-04-09

    Maybe an option to turn off PHP inspecting can be added.

     
  • Zufu Liu

    Zufu Liu - 2024-06-19
    • status: open --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2024-07-22
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.