• Login
Community
  • Login

Notepad++ XML color syntax highlighting error

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
3 Posts 3 Posters 2.5k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B
    Branimir Buljan
    last edited by Apr 21, 2018, 4:55 AM

    I have a problem that bothers me for a while and can’t find the answer googling around…
    I use a lot of XML scripts that had an element Script. And Notepad++ doesn’t like it very much…

    E.g.:

    <?xml version=“1.0”?>
    <Script attrib1=“1” attrib2=“2”>
    <book category=“children”>
    <title>Harry Potter</title>
    <author>J K. Rowling</author>
    </book>
    </Script>

    Notepad will not highlight anything after the line with element Script. Seems that it is some kind of a keyword to Notepad++ and it handles it differently.

    Is there any way to avoid this behavior?
    Thanks!

    D 1 Reply Last reply Apr 23, 2018, 1:04 PM Reply Quote 0
    • G
      Gogo Neatza
      last edited by Apr 23, 2018, 12:01 PM

      An (XML) attribute (like ‘script’) cannot contain multiple values.
      Change line two - erasing attrib1 or attrib2
      or
      make ‘script’ an element.
      You were close to “a bad workman (who) always blames his tools”.

      1 Reply Last reply Reply Quote 1
      • D
        dail @Branimir Buljan
        last edited by Apr 23, 2018, 1:04 PM

        @Branimir-Buljan

        Works for me in v7.5.6:

        You need Notepad++ v7.5.5 or later as this was fixed in that release. Also, your text uses non-ascii quotes, I replaced those with plain " instead of “ and ”

        @Gogo-Neatza

        An (XML) attribute (like ‘script’) cannot contain multiple values.

        Not sure what you mean by this. Once the quotes are replaced, this is perfectly valid XML.

        You were close to “a bad workman (who) always blames his tools”.

        In this case it was the tool.

        1 Reply Last reply Reply Quote 0
        2 out of 3
        • First post
          2/3
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors