XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
A Friday afternoon XML koan

There are many aspects of XML that require knowledge of its context. For example, earlier in the week my “XML quiz” noted that & does not always mean & (in the context of a CDATA section or a comment it means & 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]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS