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

  • From: David Brownell <david-b@p...>
  • To: Elliotte Rusty Harold <elharo@m...>, xml-dev@l...
  • Date: Thu, 23 Aug 2001 11:09:18 -0700

Hmm, complication:

    <!DOCTYPE foo [
    <!ENTITY base "http://www.example.com/namespaces/">
    ]>
    <foo xmlns="&base;FOO" xmlns:bar="&base;BAR"
        bar:barian="heathen" bar:sinister="left" />

I think that either of these event sequences should be legal (leaving
out many events); I think there are SAX2 parsers with each behavior
(and certainly could be, if there aren't).

First example, declarations reported as they're parsed:

    ...
    startEntity ("base")
    endEntity ("base")
    startPrefixMapping ("", http://www.example.com/namespaces/FOO)
    startEntity ("base")
    endEntity ("base")
    startPrefixMapping ("bar", http://www.example.com/namespaces/BAR)
    startElement (...)
    ...

Second example, there's a delayed action effect:

    ...
    startEntity ("base")
    endEntity ("base")
    startEntity ("base")
    endEntity ("base")
    startPrefixMapping ("", http://www.example.com/namespaces/FOO)
    startPrefixMapping ("bar", http://www.example.com/namespaces/BAR)
    startElement (...)
    ...

Similar examples can be constructed without a DTD; just put another
attribute between the ns decls, like name="at&amp;t".

Comments?  That is, "immediately" isn't quite right ... it's more like
any startPrefixMapping call matches the next startElement, and
endPrefixMapping matches the previous endElement.

- Dave


----- Original Message ----- 
From: "David Brownell" <david-b@p...>
To: "Elliotte Rusty Harold" <elharo@m...>; <xml-dev@l...>
Cc: <sax-devel@l...>
Sent: Monday, August 20, 2001 6:50 AM
Subject: Re: [Sax-devel] SAX namespace handling underspecified?


> > I think this is just a documentation fix to make it clear that the
> > startPrefixMapping() must be invoked immediately before the
> > corresponding startElement() method, possibly with other relevant
> > startPrefixMapping() methods intervening but no other methods. 
> > Comments? Thoughts? If there anything I've missed here? 
> 
> Sounds about right to me.  Fix to the doc looks like it is just
> adding that one word, "immediately":  immediately before,
> immediately after.  (And adjusting a plural...)
> 
> For the record, I'm viewing the javadoc as the authoritative
> text for the API spec.
> 
> - Dave
> 
> 


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