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]

Reply via email to