Пример #1
0
	// Constructor.
	public NodeManager(XmlNameTable nt, ErrorHandler eh)
			{
				current = (int)Type.None;
				attributes = null;
				error = eh;
				nodes = new NodeInfo[11];
				nodes[current] = new DefaultNodeInfo();
				xml = nt.Add("xml");
			}
Пример #2
0
	// Set the node information.
	public void SetInfo
				(bool empty, Attributes attributes, String localName,
				 String name, String namespaceURI, String prefix)
			{
				base.Reset(attributes);
				this.empty = empty;
				this.localName = localName;
				this.name = name;
				this.namespaceURI = namespaceURI;
				this.prefix = prefix;
			}
	// Process 'xml:' and 'xmlns' information for a list of attributes.
	private void ProcessAttributeInfo(Attributes attributes)
			{
				AttributeInfo info;
				int count = attributes.Count;
				for(int i = 0; i < count; ++i)
				{
					info = attributes[i];
					String tmpName = info.Name;
					String tmpValue = info.Value;
					if(((Object)tmpName) == xmlBaseName)
					{
						context.BaseURI = tmpValue;
					}
					else if(((Object)tmpName) == xmlLangName)
					{
						context.XmlLang = tmpValue;
					}
					else if(((Object)tmpName) == xmlSpaceName)
					{
						if(tmpValue == "default")
						{
							context.XmlSpace = XmlSpace.Default;
						}
						else if(tmpValue == "preserve")
						{
							context.XmlSpace = XmlSpace.Preserve;
							if(sawPreserve == -1)
							{
								sawPreserve = elementNames.Count;
							}
						}
						else
						{
							Error(/* TODO */);
						}
					}
					else if(namespaces)
					{
						XmlNamespaceManager ns = context.NamespaceManager;
						if(((Object)tmpName) == xmlNSPrefix)
						{
							ns.AddNamespace("", tmpValue);
						}
						else if(tmpName.StartsWith("xmlns:"))
						{
							String tmpLocalName = tmpName.Substring(6);
							ns.AddNamespace(tmpLocalName, tmpValue);
						}
					}
				}
			}
	// Set the node information.
	public void SetInfo(Attributes attributes, String value)
			{
				base.Reset(attributes);
				this.value = value;
			}
	// Constructor.
	protected NodeWithAttributesInfo()
			{
				index = -1;
				attributes = null;
			}
	// Reset the index and attribute information.
	protected void Reset(Attributes attributes)
			{
				this.index = -1;
				this.attributes = attributes;
			}