ConsumeRootAttributes

ConsumeRootAttributes doesn't work... Am I doing something wrong? I have GoDiagramXmlWriter private class GoDiagramXmlWriter : GoXmlWriter
{
protected override void GenerateRootAttributes()
{
base.GenerateRootAttributes();
this.WriteAttrVal("TopNodeID", this.TopNodeID.ToString("B"));
}
public Guid TopNodeID;
} It saves TopNodeID attribute to root node. I can see this attribute in XmlDocument, but: private class GoDiagramXmlReader : GoXmlReader
{
protected override object ConsumeRootAttributes(object obj)
{
object result = base.ConsumeRootAttributes(obj);
string s = this.ReadAttrVal("TopNodeID");
//this.TopNodeID = new Guid(this.ReadAttrVal("TopNodeID"));
return result;
}
public Guid TopNodeID;
} variable s is always null... What am I doing wrong?

No, that’s a bug. We forgot to set the current node before calling ConsumeRootElement and ConsumeRootAttributes.
Are you calling GoXmlReader.Consume(XmlDocument)? If so, in your override of ConsumeRootAttributes, do the following before either calling the base method or calling ReadAttrVal:
if (this.XmlDocument != null) {
// when traversing the DOM, set the ReaderNode
this.ReaderNode = this.XmlDocument.DocumentElement;
}
If you are also (or only) overriding ConsumeRootElement, add this code there instead of in ConsumeRootAttributes, since it ought to be executed just before calling ConsumeRootElement.
Sorry about that. This code will be added in the next release to the implementations of GoXmlReader.Consume.

Thanks.
It helped.