Reparenting (was Re: A constraint on markup for EMPTY elements)

(Not important point)

On Mon, 16 Sep 1996, Paul Prescod wrote:

> At 09:00 PM 9/15/96 CDT, Paul Grosso wrote:
> >At this point after reading all the "cute trick with delimiters" postings
> >that attempt to address the EMPTY element, I'm tempted to say that XML
> >just represent empty elements as everyone knows them in RCS 8879, and
> >we just have to include the "list of empty elements" information along
> >with the XML document instance.
> 
> Did we decide that the "don't worry be smart" proposal was too difficult?
> This was the proposal to force parsers to keep a stack and reparent content
> if the next end tag doesn't match the start tag. 

A simpler way is (if scanning can be done by a single DFA, and if end-tag
ommision & #CONREF are not allowed, etc.) to simply scan through for all
end-tags: if an element has an end-tag it can be added to the list of
non-empty elements. Then, the document can be parsed by a second pass with
this knowledge: no trees and reparenting, or "list of empty elements"
required.  (Whether this is a good method for the kind of tasks XML is 
intended is another matter.)



Rick Jelliffe            http://www.allette.com.au/allette/ricko
                         email: ricko@allette.com.au
================================================================
Allette Systems          http://www.allette.com.au
                         email: info@allette.com.au
10/91 York St, 2000,     phone: +61 2 9262 4777
Sydney, Australia        fax:   +61 2 9262 4774
================================================================

Received on Wednesday, 18 September 1996 08:50:43 UTC