On synthetic attributes in XmlReader

| 3 Comments | No TrackBacks

Gudge is mediatating on exposing synthetic attributes in XmlReader.
Here are some details on how I've implemented synthetic xml:base attribute in the XIncludingReader.
List of members implementing the logic:
MoveToAttribute(), MoveToFirstAttribute(), MoveToNextAttribute(), ReadAttributeValue(), HasValue, IsDefault, Name, LocalName, NamespaceURI, NodeType, Prefix, QuoteChar, MoveToNextAttribute(), ReadAttributeValue(), Value, ReadInnerXml(), ReadOuterXml(), ReadString(), AttributeCount, GetAttribute().

It's 20 (+ overloaded ones), yeah, in SAX it's much easier, but anyway that's not a rocket engineering - it's only 2-3 lines in each member after all. I wonder if in V2 XML API something would be changed, they say they are working on improving the piping also.

Another point - I'm exposing xml:base on the fly, as last attribute (as Gudge has properly supposed), but this approach doesn't help with GetAttribute(int)/MoveToAttribute(int) methods, probably I have to collect all existing attributes to some collection once and operate only on it afterwards.

Related Blog Posts

No TrackBacks

TrackBack URL: http://www.tkachenko.com/cgi-bin/mt-tb.cgi/26

3 Comments

What a nice blog.

Thanks for confirming that, Joshua!

Hi Oleg; I'm PM for XmlReader; we've talked before. Just confirming that we are trying to make things easier for implementers in V2. Primarily this means making some stuff that is currently abstract virtual. Our hands are tied a bit since we are really averse to doing anything that breaks behavior with V1. But feedback from people like you and Gudge who have implemented readers is very useful to us, and I'm interested in any other suggestions you have for ways we could help implementers. Thx