1

This is not a serious issue, but a recurring annoyance. I have a PHP class that implements several XML involved routines, in one of these I declare the header like:

$XML_Header = "<?xml version=\"1.0\"?><document></document>";

This breaks syntax highlighting in VIM about 1/3 of the time, and in SVN all of the time. For organization reasons I don't want to move this piece to the bottom of the file, is there a way I should be escaping this code? Should I include it from another file? Is there another/better way?

5
  • Since when does Subversion have syntax highlighting? Sounds weird. Commented Aug 23, 2012 at 13:58
  • I get why it's happening, the "?>", and I can break it up with "?".">" but this feels pretty 'hacky', was hoping someone knew of a better way off the top of their head. Commented Aug 23, 2012 at 13:59
  • Emil: I was referring to the SVN repo browser, and whichever JS(?) library it uses. (For us: WebSVN) Commented Aug 23, 2012 at 14:01
  • What version of vim? This doesn't happen to me.. Commented Aug 23, 2012 at 14:03
  • Happens to me on Debian vim 7.2. Commented Oct 14, 2012 at 14:48

1 Answer 1

1

Adding this as an answer as it works, isn't pretty, but gets things working. Credit to the original poster.

Split up the trailing symbols of ?> to be seperate

$XML_Header = '<?xml version="1.0" encoding="ISO-8859-1"?'.'>';
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.