Example #1
0
        private void Init(XmlReader reader, XmlSpace space, int defaultCapacity)
        {
            xmlReader             = reader;
            this.validatingReader = reader as XmlValidatingReader;
            lineInfo          = reader as IXmlLineInfo;
            this.xmlSpace     = space;
            this.nameTable    = reader.NameTable;
            nodeCapacity      = defaultCapacity;
            attributeCapacity = nodeCapacity;
            nsCapacity        = 10;
            idTable           = new Hashtable();

            nodes               = new DTMXPathLinkedNode2 [nodeCapacity];
            attributes          = new DTMXPathAttributeNode2 [attributeCapacity];
            namespaces          = new DTMXPathNamespaceNode2 [nsCapacity];
            atomicStringPool    = new string [20];
            nonAtomicStringPool = new string [20];

            Compile();
        }
 private void SetAttributeArrayLength(int size)
 {
     DTMXPathAttributeNode2[] destinationArray = new DTMXPathAttributeNode2[size];
     Array.Copy(this.attributes, destinationArray, Math.Min(size, this.attributes.Length));
     this.attributes = destinationArray;
 }