public static string GetInhaltFromXmlNode( XmlNode inhaltNode, Normalisierung normalisierung, GaitoBotEigenschaften botEigenschaften) { StringBuilder stringBuilder1 = new StringBuilder(); stringBuilder1.AppendFormat(" "); if (!inhaltNode.HasChildNodes) { stringBuilder1.Append(inhaltNode.Value); } else { foreach (XmlNode childNode in inhaltNode.ChildNodes) { if (childNode is XmlText) { stringBuilder1.Append(childNode.InnerText); } else { if (!(childNode is XmlElement)) { throw new ApplicationException(string.Format("Unbekannter XMLTyp '{0}' in Pattern '{1}'", (object)childNode.OuterXml, (object)inhaltNode.OuterXml)); } if (childNode.Name == "bot") { if (childNode.Attributes["name"] != null) { string name = childNode.Attributes["name"].Value; stringBuilder1.Append(botEigenschaften.Lesen(name)); } else { stringBuilder1.Append("BOT_UNKNOWN"); } } else { stringBuilder1.AppendFormat("[[Unbekanntes Tag '{0}' in Pattern '{1}']]", (object)childNode.OuterXml, (object)inhaltNode.OuterXml); } } } } stringBuilder1.AppendFormat(" "); string eingabe = stringBuilder1.ToString(); string[] strArray = normalisierung.StandardErsetzungenDurchfuehren(eingabe).Split(" \r\n\t".ToCharArray()); StringBuilder stringBuilder2 = new StringBuilder(); foreach (string rohEingabe in strArray) { string str = !(rohEingabe == "*") && !(rohEingabe == "_") ? Normalisierung.EingabePatternOptimieren(rohEingabe, false) : rohEingabe; if (stringBuilder2.Length == 0) { stringBuilder2.Append(str); } else { stringBuilder2.AppendFormat(" {0}", (object)str); } } return(stringBuilder2.ToString()); }
public static string GetInhaltFromXmlNode(XmlNode inhaltNode, Normalisierung normalisierung, GaitoBotEigenschaften botEigenschaften) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendFormat(" "); if (!inhaltNode.HasChildNodes) { stringBuilder.Append(inhaltNode.Value); } else { foreach (XmlNode childNode in inhaltNode.ChildNodes) { if (childNode is XmlText) { stringBuilder.Append(childNode.InnerText); continue; } if (childNode is XmlElement) { if (childNode.Name == "bot") { if (childNode.Attributes["name"] != null) { string value = childNode.Attributes["name"].Value; stringBuilder.Append(botEigenschaften.Lesen(value)); } else { stringBuilder.Append("BOT_UNKNOWN"); } } else { stringBuilder.AppendFormat("[[Unbekanntes Tag '{0}' in Pattern '{1}']]", childNode.OuterXml, inhaltNode.OuterXml); } continue; } throw new ApplicationException(string.Format("Unbekannter XMLTyp '{0}' in Pattern '{1}'", childNode.OuterXml, inhaltNode.OuterXml)); } } stringBuilder.AppendFormat(" "); string eingabe = stringBuilder.ToString(); eingabe = normalisierung.StandardErsetzungenDurchfuehren(eingabe); string[] array = eingabe.Split(" \r\n\t".ToCharArray()); stringBuilder = new StringBuilder(); string[] array2 = array; foreach (string text in array2) { string text2 = (!(text == "*") && !(text == "_")) ? Normalisierung.EingabePatternOptimieren(text, false) : text; if (stringBuilder.Length == 0) { stringBuilder.Append(text2); } else { stringBuilder.AppendFormat(" {0}", text2); } } return(stringBuilder.ToString()); }