[Home] [By Thread] [By Date] [Recent Entries]

  • From: Roger L Costello <costello@m...>
  • To: "xml-dev@l..." <xml-dev@l...>
  • Date: Fri, 6 May 2022 20:59:24 +0000

There are many aspects of XML that require knowledge of its context. For example, earlier in the week my “XML quiz” noted that &amp; does not always mean & (in the context of a CDATA section or a comment it means &amp; but otherwise it means &)

 

So things are context-dependent.

 

Another way of saying it is: Things are context-sensitive. XML is context-sensitive.

 

Koan: If XML isn’t context-free, why are we always writing context-free grammars for it?  (And don't say, "Because it's useful to do so;" that begs the question:  Why is it useful?)

 

Scroll down to see the answer …………..

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Even though XML isn’t context-free as such, it is locally context-free, in the sense that the set of permissible expressions within a small region in a particular XML document can be described by a context-free grammar.

 

Adapted from the article “The Concept of Grammar Adaptability” by John N. Shutt (https://web.cs.wpi.edu/~jshutt/adapt/concept.html)

 

 



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member