Пример #1
0
		public override Item newItem(XmlNode node,
			XmlEditor document)
		{
			Item item = null;

			if (node.NodeType == XmlNodeType.Element) 
			{
				item = new ElementItem(document);
			}
			else if (node.NodeType == XmlNodeType.Attribute )
			{
				item = new AttrItem(document);
			}
			else if (node.NodeType == XmlNodeType.Text) 
			{
				item = new TextItem(document);
			}
			else if (node.NodeType == XmlNodeType.ProcessingInstruction )
			{
				item = new ProcessingInstructionItem(document);
			}
			else if (node.NodeType == XmlNodeType.XmlDeclaration )
			{
				item = new DeclarationItem(document);
			}
			else if (node.NodeType == XmlNodeType.Comment)
			{
				item = new CommentItem(document);
			}
			else if (node.NodeType == XmlNodeType.CDATA)
			{
				item = new CDATAItem(document);
			}
			else if (node.NodeType == XmlNodeType.DocumentType)
			{
				item = new DocumentTypeItem(document);
			}
			else if (node.NodeType == XmlNodeType.EntityReference)
			{
				item = new EntityReferenceItem(document);
			}

			//item.m_document = document;
			return item;
		}
Пример #2
0
        public override Item newItem(XmlNode node,
                                     XmlEditor document)
        {
            Item item = null;

            if (node.NodeType == XmlNodeType.Element)
            {
                item = new ElementItem(document);
            }
            else if (node.NodeType == XmlNodeType.Attribute)
            {
                item = new AttrItem(document);
            }
            else if (node.NodeType == XmlNodeType.Text)
            {
                item = new TextItem(document);
            }
            else if (node.NodeType == XmlNodeType.ProcessingInstruction)
            {
                item = new ProcessingInstructionItem(document);
            }
            else if (node.NodeType == XmlNodeType.XmlDeclaration)
            {
                item = new DeclarationItem(document);
            }
            else if (node.NodeType == XmlNodeType.Comment)
            {
                item = new CommentItem(document);
            }
            else if (node.NodeType == XmlNodeType.CDATA)
            {
                item = new CDATAItem(document);
            }
            else if (node.NodeType == XmlNodeType.DocumentType)
            {
                item = new DocumentTypeItem(document);
            }
            else if (node.NodeType == XmlNodeType.EntityReference)
            {
                item = new EntityReferenceItem(document);
            }

            //item.m_document = document;
            return(item);
        }
Пример #3
0
		// 创建一个DocumentTypeItem
		// parameter:
		//		strName	名称
		public DocumentTypeItem CreateDocumentTypeItem(string strName,
			string strValue)
		{
			DocumentTypeItem item = new DocumentTypeItem(this);
			item.Name = strName;
			item.SetValue(strValue);
			return item;
		}