0

I try understand XML definition, but stuck on 'CharData' token. It's taken from http://www.w3.org/TR/xml/#NT-Char. From regural expression I know that "-" is used for range, but don't get it in this case. Can somebody please explain me what is meaning of this expressions?

[14]    CharData       ::=      [^<&]* - ([^<&]* ']]>' [^<&]*)
[15]    Comment    ::=      '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'

Thanks.

Mara
  • 3
  • 1

1 Answers1

0

It's explained in the Notation section of the same doc:

A - B

matches any string that matches A but does not match B.

In the particular case of CharData, it is defined as a sequence of any characters except < and &. That sequence, however, shouldn't contain ]]> string (CDATA section-close delimiter).

raina77ow
  • 103,633
  • 15
  • 192
  • 229