Northwoods.GoWeb.Xml Assembly > Northwoods.GoWeb.Xml Namespace > GoXmlReaderWriterBase Class : ObjectStack Property |
List
of Object
acting as a stack of Objects that have been created during the walking of the XML tree during Consume
, or that have been seen during Generate
.'Declaration Public ReadOnly Property ObjectStack As List(Of Object)
public List<object> ObjectStack {get;}
During a GoXmlReader.Consume
, the bottom object, at index zero, will be the result of ConsumeRootElement. ConsumeObject will push the result of InvokeAllocate onto this stack just before calling InvokeConsumeBody, and then pop it off immediately afterwards. Hence during the processing of an element's body, i.e. during calls to IGoXmlTransformer.ConsumeBody, the value of ParentObject will be that parent element. Access to the whole stack of objects may be needed for establishing the context in which objects should be searched for, created, or modified. For example, when reading an element representing a node that has nested elements representing parts of the node, such as ports, the transformer for ports may need to implement GoXmlTransformer.Allocate to return an existing port of the node, rather than blindly allocating a new one that would conflict with the existing port.
During a GoXmlWriter.Generate
, the bottom object, at index zero, will be the value of Objects. GenerateObject will push the argument Object
onto this stack just before calling GoXmlWriter.InvokeGenerateBody, and the pop it off immediately afterwards. Hence during the processing of an element's body, i.e. during calls to IGoXmlTransformer.GenerateBody, the value of ParentObject will be that "parent" object. Access to the whole stack of objects may be needed for establishing the context in which objects should generated, or to permit communication between the transformers for those objects.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2