Home > Blockchain >  First rule of a "Well-Formed XML Document"
First rule of a "Well-Formed XML Document"

Time:12-31

This is the first rule of the XML specification.

[1] document ::= ( prolog element Misc* ) - ( Char* RestrictedChar Char* )

I understand the first part: a document contains a prolog, an element and optional Misc-items.

But I do not understand the part starting with the hyphen. What does this mean? Can anybody give an example for a document containing such thing?

CodePudding user response:

In Extended Backus-Naur Form,

A - B

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

Therefore, an XML document,

[1] document ::= ( prolog element Misc* ) - ( Char* RestrictedChar Char* )

must match the first part ( prolog element Misc* ) without matching the second part ( Char* RestrictedChar Char* ) or, in short...

An XML document must not include any restricted characters.

  • Related