RD_WF
RD_WF

Reputation: 115

Minus in w3c specification grammar

What does the minus sign mean?

[14]    CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)

From the w3c XML 1.0 specification

Also, where can I find information related to the syntax grammar? I'm having troubling finding the specification about the specification, if that makes any sense.

Upvotes: 3

Views: 379

Answers (1)

kjhughes
kjhughes

Reputation: 111696

Minus (-) is part of the Extended Backus-Naur Form (EBNF) notation used by the W3C XML Recommendation to define the formal grammar of XML:

  • Minus (-) in A - B matches any string that matches A but does not match B.

How to interpret the CharData production

[14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)

  • [^<&]* is a string of any characters except the markup start characters, < and &.
  • ']]>' is a literal string that is used to mark the end of CDATA.
  • ([^<&]* ']]>' [^<&]*) is any string without < and & that doesn't contain the end marker for a CDATA section.

Therefore, altogether, CharData can be any string that doesn't contain the markup start characters, < and &, and doesn't contain the CDATA end marker, ]]>.

See also

Upvotes: 2

Related Questions