示例#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;
		}
示例#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
		public DTMXPathDocument (XmlNameTable nameTable,
			DTMXPathLinkedNode [] nodes,
			DTMXPathAttributeNode [] attributes,
			DTMXPathNamespaceNode [] namespaces,
			Hashtable idTable)
		{
			root = new DTMXPathNavigator (this,
				nameTable,
				nodes,
				attributes,
				namespaces,
				idTable);
		}
示例#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;
		}
示例#5
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 ();
		}
示例#6
0
		// Followings are skipped: nextAttribute,
		public void AddAttribute (int ownerElement, string localName, string ns, string prefix, string value, object schemaType, int lineNumber, int linePosition)
		{
			if (attributes.Length < attributeIndex + 1) {
				attributeCapacity *= 4;
				SetAttributeArrayLength (attributeCapacity);
			}

#if DTM_CLASS
			attributes [attributeIndex] = new DTMXPathAttributeNode ();
#endif
			attributes [attributeIndex].OwnerElement = ownerElement;
			attributes [attributeIndex].LocalName = localName;
			attributes [attributeIndex].NamespaceURI = ns;
			attributes [attributeIndex].Prefix = prefix;
			attributes [attributeIndex].Value = value;
			attributes [attributeIndex].SchemaType = schemaType;
			attributes [attributeIndex].LineNumber = lineNumber;
			attributes [attributeIndex].LinePosition = linePosition;
		}
示例#7
0
		private void SetAttributeArrayLength (int size)
		{
			DTMXPathAttributeNode [] newArr = 
				new DTMXPathAttributeNode [size];
			Array.Copy (attributes, newArr, System.Math.Min (size, attributes.Length));
			attributes = newArr;
		}