Пример #1
0
        // Here followings are skipped: firstChild, nextSibling,
        public void AddNode(int parent, int firstAttribute, int previousSibling, int depth, XPathNodeType nodeType, string baseUri, bool isEmptyElement, string localName, string ns, string prefix, string value, string xmlLang, int namespaceNode, int lineNumber, int linePosition)
        {
            if (nodes.Length < nodeIndex + 1)
            {
                nodeCapacity *= 4;
                SetNodeArrayLength(nodeCapacity);
            }

#if DTM_CLASS
            nodes [nodeIndex] = new DTMXPathLinkedNode();
#endif
            nodes [nodeIndex].FirstChild      = 0;                      // dummy
            nodes [nodeIndex].Parent          = parent;
            nodes [nodeIndex].FirstAttribute  = firstAttribute;
            nodes [nodeIndex].PreviousSibling = previousSibling;
            nodes [nodeIndex].NextSibling     = 0;              // dummy
            nodes [nodeIndex].Depth           = depth;
            nodes [nodeIndex].NodeType        = nodeType;
            nodes [nodeIndex].BaseURI         = baseUri;
            nodes [nodeIndex].IsEmptyElement  = isEmptyElement;
            nodes [nodeIndex].LocalName       = localName;
            nodes [nodeIndex].NamespaceURI    = ns;
            nodes [nodeIndex].Prefix          = prefix;
            nodes [nodeIndex].Value           = value;
            nodes [nodeIndex].XmlLang         = xmlLang;
            nodes [nodeIndex].FirstNamespace  = namespaceNode;
            nodes [nodeIndex].LineNumber      = lineNumber;
            nodes [nodeIndex].LinePosition    = linePosition;
        }
Пример #2
0
        public DTMXPathDocumentWriter(XmlNameTable nt, int defaultCapacity)
        {
            nameTable         = nt == null ? new NameTable() : nt;
            nodeCapacity      = defaultCapacity;
            attributeCapacity = nodeCapacity;
            idTable           = new Hashtable();

            nodes      = new DTMXPathLinkedNode [nodeCapacity];
            attributes = new DTMXPathAttributeNode [attributeCapacity];
            namespaces = new DTMXPathNamespaceNode [0];

            Init();
        }
Пример #3
0
        private void Init(XmlReader reader, XmlSpace space, int defaultCapacity)
        {
            this.xmlReader        = reader;
            this.validatingReader = reader as XmlValidatingReader;
            lineInfo          = reader as IXmlLineInfo;
            this.xmlSpace     = space;
            this.nameTable    = reader.NameTable;
            nodeCapacity      = defaultCapacity;
            attributeCapacity = nodeCapacity;
            idTable           = new Hashtable();

            nodes      = new DTMXPathLinkedNode [nodeCapacity];
            attributes = new DTMXPathAttributeNode [attributeCapacity];
            namespaces = new DTMXPathNamespaceNode [0];

            Compile();
        }
 private void SetNodeArrayLength(int size)
 {
     DTMXPathLinkedNode[] destinationArray = new DTMXPathLinkedNode[size];
     Array.Copy(this.nodes, destinationArray, Math.Min(size, this.nodes.Length));
     this.nodes = destinationArray;
 }
Пример #5
0
 private void SetNodeArrayLength(int size)
 {
     DTMXPathLinkedNode [] newArr = new DTMXPathLinkedNode [size];
     Array.Copy(nodes, newArr, System.Math.Min(size, nodes.Length));
     nodes = newArr;
 }