Exemple #1
0
		public DTMXPathDocument (XmlNameTable nameTable,
			DTMXPathLinkedNode [] nodes,
			DTMXPathAttributeNode [] attributes,
			DTMXPathNamespaceNode [] namespaces,
			Hashtable idTable)
		{
			this.nameTable = nameTable;
			this.nodes = nodes;
			this.attributes = attributes;
			this.namespaces = namespaces;
			this.idTable = idTable;
		}
		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 ();
		}
Exemple #3
0
		public DTMXPathDocument (XmlNameTable nameTable,
			DTMXPathLinkedNode [] nodes,
			DTMXPathAttributeNode [] attributes,
			DTMXPathNamespaceNode [] namespaces,
			Hashtable idTable)
		{
			root = new DTMXPathNavigator (this,
				nameTable,
				nodes,
				attributes,
				namespaces,
				idTable);
		}
Exemple #4
0
		public DTMXPathNavigator (DTMXPathDocument document,
			XmlNameTable nameTable, 
			DTMXPathLinkedNode [] nodes,
			DTMXPathAttributeNode [] attributes,
			DTMXPathNamespaceNode [] namespaces,
			Hashtable idTable)
		{
			this.nodes = nodes;
			this.attributes = attributes;
			this.namespaces = namespaces;
			this.idTable = idTable;
			this.nameTable = nameTable;
			this.MoveToRoot ();
			this.document = document;
		}
		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 ();
		}
		// 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;
		}
		private void SetNodeArrayLength (int size)
		{
			DTMXPathLinkedNode [] newArr = new DTMXPathLinkedNode [size];
			Array.Copy (nodes, newArr, System.Math.Min (size, nodes.Length));
			nodes = newArr;
		}