Notepad++ XML color syntax highlighting error
-
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! -
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”. -
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”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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login