当前位置: 首页>>代码示例>>C#>>正文


C# XmlNode.ToString方法代码示例

本文整理汇总了C#中System.Xml.XmlNode.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# XmlNode.ToString方法的具体用法?C# XmlNode.ToString怎么用?C# XmlNode.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.XmlNode的用法示例。


在下文中一共展示了XmlNode.ToString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ActualProcess

		private void ActualProcess(XmlNode node, bool isRoot, ITemplate template, IRenderFunction currentRenderFunction) {
			foreach (INodeProcessor p in processors) {
				if (p.TryProcess(this, node, isRoot, template, currentRenderFunction))
					return;
			}
			throw ParserUtils.TemplateErrorException("The node " + node.ToString() + " could not be handled.");
		}
开发者ID:fiinix00,项目名称:Saltarelle,代码行数:7,代码来源:DocumentProcessor.Shared.cs

示例2: ReceivedAvatarMetadata

        private void ReceivedAvatarMetadata(JID from, string node, XmlNode items)
        {
            if (items.ChildNodes.Count == 0)
                return;

            Console.WriteLine("Received Avatar Data");
            Console.WriteLine(items.ToString());
        }
开发者ID:jrudolph,项目名称:synapse,代码行数:8,代码来源:UserAvatars.cs

示例3: Create

 /// <summary>
 /// Returns the section parameter
 /// </summary>
 /// <param name="parent"></param>
 /// <param name="configContext"></param>
 /// <param name="section"></param>
 /// <returns>section</returns>
 public object Create(object parent,object configContext,XmlNode section)
 {
     if (Log.IsInfoEnabled) Log.Info("CodeColorizer AppSettings:\n" + section.ToString() );
     return section;
 }
开发者ID:vanzheng,项目名称:CShareCodeSample,代码行数:12,代码来源:ConfigurationSectionHandler.cs

示例4: DeleteXmlNode

 /// <summary>
 /// ɾ��ָ����XML�ڵ�
 /// </summary>
 /// <param name="clsRootNode">��ɾ���Ľڵ�</param>
 /// <returns>�Ƿ�ɾ���ɹ�</returns>
 public static bool DeleteXmlNode(XmlNode clsDeletedNode)
 {
     if (clsDeletedNode == null)
         return true;
     try
     {
         if (clsDeletedNode.ParentNode != null)
             clsDeletedNode.ParentNode.RemoveChild(clsDeletedNode);
         return true;
     }
     catch (Exception ex)
     {
         LogManager.Instance.WriteLog("GlobalMethods.DeleteXmlNode"
             , new string[] { "clsDeletedNode" }, new string[] { clsDeletedNode.ToString() }, ex);
         return false;
     }
 }
开发者ID:zuifengke,项目名称:windy-common,代码行数:22,代码来源:Xml.cs

示例5: markupText

        /// <summary>
        /// Función para marcar la cadena de texto
        /// </summary>
        /// <param name="refPattern">Expresión regular</param>
        /// <param name="refString">Cadena para buscar coincidencias</param>
        /// <param name="refStruct">Instrucciones de marcado</param>
        /// <returns>La cadena marcada</returns>
        private String markupText(String refPattern, String refString, XmlNode refStruct)
        {
            if (log.IsInfoEnabled) log.Info("Begin");
            if (log.IsDebugEnabled) log.Debug("markupText(refPattern: " + refPattern + ", refString: " + refString + ", refStruct: " + refStruct.ToString() + ")");
            /* Definición de variables */
            bool singleOptionMatch = false;
            int  singleOptionMatched = 0;
            String replaceGeneral = "";
            String patternString = null;
            String subjectString = null;
            String tagStringOpen = null;
            String tagStringClose = null;
            String backreference = null;
            String backreferencePostValue = null;
            String backreferencePreValue = null;
            String replaceString = null;
            String resultString = "";
            String multipleOptionPattern = null;
            String singleOptionPattern = null;
            Regex objRegExp = null;
            Regex multipleOptionRegExp = null;
            String openTag = "<";
            String closeTag = ">";
            RegexOptions options = RegexOptions.Compiled | RegexOptions.Multiline;
            Match matchResults = null;
            Match multipleOptionsMarchResults = null;
            XmlNode structNode = null;
            XmlNodeList multipleOptions = null;
            XmlNode singleOptionStruct = null;
            /* Verificamos si la cadena es nula antes de evaluarla */
            if (refString != null)
            {
                /* Iniciando búsqueda del patron en la cadena de texto */
                objRegExp = new Regex(refPattern, options);
                matchResults = objRegExp.Match(refString);
                /* Verificamos si hay alguna coincidencia e iteramos todas las coincidencias encontradas*/
                if (matchResults.Success)
                {
                    while (matchResults.Success)
                    {
                        replaceGeneral = "";
                        /* Iteramos los nodos dentro del xml que nos dan el contenido de las citas */
                        foreach (XmlNode itemXML in refStruct.ChildNodes)
                        {
                            /* Verificamos que el nodo hijo sea diferente de prevalue, postvalue y attr */
                            if (itemXML.Name != "prevalue" && itemXML.Name != "postvalue" && itemXML.Name != "attributes")
                            {
                                /* Verificamos si el nodo es una etiqueta(tag) o no */
                                if (itemXML.Name == "tag")
                                {
                                    /*Verificamos y agregamos atributos por omisión  a la etiqueta de apertura*/
                                    if (itemXML.SelectSingleNode("attributes") == null)
                                    {
                                        tagStringOpen = openTag + itemXML.Attributes["name"].Value + closeTag;
                                    }
                                    else
                                    {
                                        tagStringOpen = openTag + itemXML.Attributes["name"].Value;
                                        foreach (XmlNode attrNode in itemXML.SelectSingleNode("attributes"))
                                        {
                                            if (attrNode.Attributes["name"].Value == "dateiso" && attrNode.InnerText == "")
                                            {
                                                tagStringOpen += " " + attrNode.Attributes["name"].Value + "=\"" + objRegExp.Replace(refString, itemXML.SelectSingleNode("value").InnerText) + "0000\"";
                                            }
                                            else
                                            {
                                                tagStringOpen += " " + attrNode.Attributes["name"].Value + "=\"" + attrNode.InnerText + "\"";
                                            }
                                        }
                                        tagStringOpen += closeTag;
                                    }
                                    tagStringClose = openTag + "/" + itemXML.Attributes["name"].Value + closeTag;
                                }
                                else
                                {
                                    tagStringOpen = null;
                                    tagStringClose = null;
                                }
                                /* Verificamos si el nodo contiene un valor directo para la etiqueta(tag) o si su valor esta compuesto otras etiquetas(tag) */
                                if (itemXML.SelectSingleNode("value") == null)
                                {
                                    /* Verificamos si hay que poner un valor antes de la etiqueta(tag) */
                                    if (itemXML.SelectSingleNode("prevalue") != null)
                                    {
                                        backreferencePreValue = itemXML.SelectSingleNode("prevalue").InnerText;
                                        replaceGeneral += backreferencePreValue;

                                    }
                                    /* Si esta compuesto de otras etiquetas(tag) volvemos a enviar la cadena y el patron con los nodos hijos de la etiqueta(tag) */
                                    replaceGeneral += tagStringOpen + this.markupText(refPattern, refString, itemXML) + tagStringClose;
                                    /* Verificamos si hay que poner un valor despues de la etiqueta(tag) */
                                    if (itemXML.SelectSingleNode("postvalue") != null)
                                    {
//.........这里部分代码省略.........
开发者ID:swarzesherz,项目名称:RegexMarkup,代码行数:101,代码来源:RegexMarkup.cs

示例6: ProcessRow

        /// <summary>
        ///     Parses the XML node and imports it.
        /// </summary>
        /// <param name="rowNode">The node.</param>
        protected void ProcessRow(XmlNode rowNode)
        {
            XmlNodeList cells = rowNode.ChildNodes;
            if (cells.Count != kNumberOfColumns)
            {
                Console.WriteLine ("ERROR: Wrong number of columns in row {0}", rowNode.ToString ());
                return;
            }

            //------------ Add to DB
            string lastName = cells[kLastNameColumnIndex].InnerText;
            string firstName = cells[kFirstNameColumnIndex].InnerText;
            if (firstName == null || firstName.Equals (""))
            {
                firstName = "Nezname";
            }

            string birthYear = cells[kBirthYearColumnIndex].InnerText;

            string birthPlace = cells[kBirthPlaceColumnIndex].InnerText;

            string[] countryStrings = new string[2];
            countryStrings[0] = cells[kStateFirstColumnIndex].InnerText;
            countryStrings[1] = cells[kStateSecondColumnIndex].InnerText;
            List<Country> countries = ConvertStringCountriesToCountryArray (countryStrings);

            string dbAdditionYear = cells[kAddedToDatabaseYearColumnIndex].InnerText;

            string sexValue = cells[kSexColumnIndex].InnerText;
            Sex sex = Sex.Male;
            if (sexValue != null)
            {
                sex = sexValue.Equals (kMaleSexIdentifier) ? Sex.Male : Sex.Female;
            }
            string department = cells[kDepartmentColumnIndex].InnerText;
            string departmentComment = cells[kDepartmentCommentColumnIndex].InnerText;
            string administration = cells[kAdministrationColumnIndex].InnerText;
            string administrationComment = cells[kAdministrationCommentColumnIndex].InnerText;
            string pozorka1 = cells[kPozorkaFirstColumnIndex].InnerText;
            string pozorka2 = cells[kPozorkaSecondColumnIndex].InnerText;

            Person p = TryToFindPerson (firstName, lastName, birthYear, sex, birthPlace);
            if (p == null)
            {
                // Need to create a new person
                p = new Person ();
                p.FirstName = firstName;
                p.Surname = lastName;
                if (birthYear != null && !birthYear.Equals (""))
                {
                    p.BirthDate = birthYear;
                }
                p.Sex = sex;
                p.Nationality = Nationality.Unknown;
                p.Note = string.Format ("{0} {1}\n{2} {3}\n{4} {5}\n{6} {7}",
                    kPlaceOfBirthNoteCaption, birthPlace,
                    kPozorka1NoteCaption, pozorka1,
                    kPozorka2NoteCaption, pozorka2,
                    kAddedToStbDatabaseNoteCaption, dbAdditionYear);

                if (countries.Count > 0)
                {
                    p.Citizenships = countries;
                }

                _ctx.Entities.Add (p);
            }

            StbDivision StbDepartment = GetStbDivisionByName (department);
            StbDivision StbAdministration = GetStbDivisionByName (administration);

            Relation departmentRelation = null;
            Relation administrationRelation = null;

            ICollection<Relation> relations = p.ObjectiveRelations;
            if (relations != null)
            {
                foreach (Relation r in relations)
                {
                    if (StbDepartment != null && r.SubjectiveEntityId == StbDepartment.Id)
                    {
                        departmentRelation = r;
                    }
                    else if (StbAdministration != null && r.SubjectiveEntityId == StbAdministration.Id)
                    {
                        administrationRelation = r;
                    }
                }
            }

            if (departmentRelation == null && StbDepartment != null)
            {
                // Need to add a relation
                AddStbRelationToPerson (p, StbDepartment, departmentComment, GetRelationType (kRelationDepartmentType));
            }
            if (administrationRelation == null && StbAdministration != null)
//.........这里部分代码省略.........
开发者ID:payola,项目名称:PayolaIS,代码行数:101,代码来源:ScraperBase.cs

示例7: NextNotBlank

        /// <summary>
        /// test the given node, if it is a comment or is empty; if it is empty, try the next nodes.
        /// </summary>
        /// <param name="cur2">the current node</param>
        /// <returns>the current or the first next node with actual content
        /// </returns>
        public static XmlNode NextNotBlank(XmlNode cur2)
        {
            XmlNode cur;

            cur = cur2;

            while (true)
            {
                if (cur == null)
                {
                    return cur;
                }

                if ((cur.NodeType == System.Xml.XmlNodeType.Text) && (cur.ToString().Length == 0))
                {
                    cur = cur.NextSibling;
                    continue;
                }

                if (cur.Name == "comment")
                {
                    cur = cur.NextSibling;
                    continue;
                }

                if (cur.Name == "#comment")
                {
                    cur = cur.NextSibling;
                    continue;
                }

                return cur;
            }
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:40,代码来源:XmlParser.cs


注:本文中的System.Xml.XmlNode.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。