in reply to Re: Re: Re: regex on XML
in thread regex on XML

Yes it is - if you don't encode apostrophes inside an apostrophe quoted string your XML is immediately invalid. Same thing for double-quotes.

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: regex on XML
by CountZero (Bishop) on Feb 18, 2004 at 07:29 UTC
    Well I guess it is just a matter of semantics: XML does not need single and double quotes encoded, but it needs them balanced. Either way the XML is "bad".

    Most of the time you can get away with the encoding by putting single quotes within double quotes and vice versa.

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

      Er, these all fall into the category of syntax errors. XML is just more permissive about the places where you can get away without handling these particular characters specially. Really, when you next tell someone this you'll be incorrect if you artificially call this "balancing" but the other stuff "invalid". Its equally invalid either way. This isn't a sort of "well ... it was mostly ok" operation. XML validity is either 100% one way or the other. This just happens to be a rule that can tip your XML into being invalid.
      A reply falls below the community's threshold of quality. You may see it by logging in.