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

#if DTM_CLASS
            nodes [nodeIndex] = new DTMXPathLinkedNode2();
#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].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;
        }
        // Here followings are skipped: firstChild, nextSibling,
        public void AddNode(int parent, int firstAttribute, int previousSibling, 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 DTMXPathLinkedNode2();
#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].NodeType        = nodeType;
            nodes [nodeIndex].BaseURI         = AtomicIndex(baseUri);
            nodes [nodeIndex].IsEmptyElement  = isEmptyElement;
            nodes [nodeIndex].LocalName       = AtomicIndex(localName);
            nodes [nodeIndex].NamespaceURI    = AtomicIndex(ns);
            nodes [nodeIndex].Prefix          = AtomicIndex(prefix);
            nodes [nodeIndex].Value           = NonAtomicIndex(value);
            nodes [nodeIndex].XmlLang         = AtomicIndex(xmlLang);
            nodes [nodeIndex].FirstNamespace  = namespaceNode;
            nodes [nodeIndex].LineNumber      = lineNumber;
            nodes [nodeIndex].LinePosition    = linePosition;
        }
        public DTMXPathDocumentWriter2(XmlNameTable nt, int defaultCapacity)
        {
            nameTable         = nt == null ? new NameTable() : nt;
            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];

            Init();
        }
Beispiel #4
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;
            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 SetNodeArrayLength(int size)
 {
     DTMXPathLinkedNode2[] destinationArray = new DTMXPathLinkedNode2[size];
     Array.Copy(this.nodes, destinationArray, Math.Min(size, this.nodes.Length));
     this.nodes = destinationArray;
 }
Beispiel #6
0
 private void SetNodeArrayLength(int size)
 {
     DTMXPathLinkedNode2 [] newArr = new DTMXPathLinkedNode2 [size];
     Array.Copy(nodes, newArr, System.Math.Min(size, nodes.Length));
     nodes = newArr;
 }