XML parser hangs on silly comment


#1

XML parsing hangs on the following line. Removing the first > fixes the problem. Dunno whether this is illegal in the XML spec, or if it’s just an incidental problem.


#2

[quote=“fgcapo”]XML parsing hangs on the following line. Removing the first > fixes the problem. Dunno whether this is illegal in the XML spec, or if it’s just an incidental problem.

[/quote]

I’m not really an export, but the first > looks illegal to me at any rate.


#3

An XML comment tag starts with . The comment itself (which may even consist of otherwise valid XML) is everything contained within these markers. I guess the space is necessary after the <!-- … having a ‘>’ immediately afterwards, if not actually invalid, would at least suggest you may intend for the comment to close immediately.


#4

You scared me when you said the parser “hangs”!

It’d be very serious if invalid XML could cause the parser to actually hang! For anyone reading who might be alarmed by the thread title: don’t worry, this isn’t a bug, the parser just correctly returns a null pointer, and it certainly doesn’t lock-up!


#5

Oh, it actually does hang on my machine. Took a while to track it down. I’ll check with my teammates and see if anyone’s made changes to the JUCE source.


#6

Well, that snippet didn’t fail when I tried it - if you have a longer piece of XML that does show problems, let me know.


#7

Whether a single comment is valid XML sounds like an ontological question…

[code]<?xml version="1.0" encoding="UTF-8"?>

<ContentData>
  <type>pattern</type>
</ContentData>
[/code]

#8

Ah! Thanks, that was a bug - fixed now!