Ejemplo n.º 1
0
 private void SetNsArrayLength(int size)
 {
     DTMXPathNamespaceNode [] newArr =
         new DTMXPathNamespaceNode [size];
     Array.Copy(namespaces, newArr, System.Math.Min(size, namespaces.Length));
     namespaces = newArr;
 }
Ejemplo n.º 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();
        }
Ejemplo n.º 3
0
        // Followings are skipped: nextNsNode (may be next attribute in the same element, or ancestors' nsNode)
        public void AddNsNode(int declaredElement, string name, string ns, int nextNs)
        {
            if (namespaces.Length < nsIndex + 1)
            {
                nsCapacity *= 4;
                SetNsArrayLength(nsCapacity);
            }

#if DTM_CLASS
            namespaces [nsIndex] = new DTMXPathNamespaceNode();
#endif
            namespaces [nsIndex].DeclaredElement = declaredElement;
            namespaces [nsIndex].Name            = name;
            namespaces [nsIndex].Namespace       = ns;
            namespaces [nsIndex].NextNamespace   = nextNs;
        }
Ejemplo n.º 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;
            idTable           = new Hashtable();

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

            Compile();
        }
 private void SetNsArrayLength(int size)
 {
     DTMXPathNamespaceNode[] destinationArray = new DTMXPathNamespaceNode[size];
     Array.Copy(this.namespaces, destinationArray, Math.Min(size, this.namespaces.Length));
     this.namespaces = destinationArray;
 }