Hi Lucian,

I believe Hua Lei is still working on the implementation (there's still 
about a week before Google Summer of Code ends) though I'm not sure 
whether he's aware of these issues. I just committed fixes for getName() 
and getPrefix(). Can you open JIRAs for the other two problems?

In my opinion we should be storing the element and attribute namespace 
URIs from the SAX events and returning them instead of looking them up 
from the namespace context. This isn't just for performance reasons. It's 
possible that an attribute reported by the SAX parser may have a namespace 
but no prefix (for instance if it was defaulted from an XML schema). In 
such a case the namespace context look-up won't even work.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]

Lucian Holland <[EMAIL PROTECTED]> wrote on 08/13/2006 06:47:09 PM:

> Hi,
> 
> I've started trying to test my event reader code with the initial 
> contribution for the SAXXMLStreamReaderImpl rather than Woodstox. I've 
> noticed a couple of minor bugs which I've corrected in my checkout to 
> try and get things working, but I'm now blocked on something more 
> substantial. The minor bits were:
> 
>  - The code seems to assume that xmlns attributes will be in the 
> attributes passed into the startElement method; AFACIT this is only the 
> case if |http://xml.org/sax/features/namespace-prefixes is set to true 
> (false by default)[1] The result is that namespace bindings don't get 
> noticed properly unless this feature is set to true.
> 
> - getName() has the constructor arguments the wrong way round for QName; 

> also, it doesn't appear to pass in the prefix (this is also true for the 

> construction of attribute QNames in getAttributeName()), so you seem to 
> lose all prefix information!
> 
> - getPrefix() has a typo in the initial condition - both checks are for 
> START_ELEMENT, rather than one being for END_ELEMENT
> 
> 
> The more complex problem I've come across is that initialElementAttrs() 
> sets the prefix of attributes to null if it finds no colon in the 
> attribute name; the problem with this is that getAttributeNamespace() 
> uses this prefix when looking up the namespace uri with a call to 
> getNamespaceURI on the NamespaceContextImpl, and this method throws an 
> IllegalArgumentException if null is passed in. I'm hesitant to wade in 
> and change stuff without consultation here given the recent discussion 
> on stax_builders about the use null in QNames... Seems like there should 

> be a consistent strategy on the ""/null thing to avoid this sort of 
> confusion... Thoughts?
> 
> Obviously happy to submit a patch for the simple stuff if appropriate 
> (and indeed the other bug when we decide how nulls should be used in 
> this case).
> 
> Thanks,
> 
> Lucian
> 
> 
> [1] http://java.sun.com/j2se/1.5.0/docs/api/org/xml/sax/Attributes.html
> |
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to