protected YMean GetYMean(XmlElement node) { YMean mean = new YMean { AttrGender = node.GetAttribute("gen"), AttrNum = node.GetAttribute("num"), AttrPartOfSpeech = node.GetAttribute("pos"), AttrText = node.GetAttribute("text") }; foreach (XmlElement nodeChild in node.ChildNodes) { if (nodeChild.LocalName == "text") { mean.Mean = nodeChild.InnerText; } if (nodeChild.LocalName == "tr") { foreach (XmlElement nodeMeanTr in nodeChild.ChildNodes) { if (nodeMeanTr.LocalName == "text") { mean.MeanTranslation = nodeMeanTr.InnerText; } } } } return(mean); }
protected YTranslation GetYTranslation(XmlElement node) { YTranslation tr = new YTranslation { AttrGender = node.GetAttribute("gen"), AttrNum = node.GetAttribute("num"), AttrPartOfSpeech = node.GetAttribute("pos"), AttrText = node.GetAttribute("text") }; foreach (XmlElement nodeChild in node.ChildNodes) { if (nodeChild.LocalName == "text") { tr.AttrTranslation = nodeChild.InnerText; } if (nodeChild.LocalName == "mean") { YMean mean = GetYMean(nodeChild); tr.Means.Add(mean); } if (nodeChild.LocalName == "ex") { YExample example = GetYExample(nodeChild); tr.Examples.Add(example); } if (nodeChild.LocalName == "syn") { YSynonym synonym = GetYSynonym(nodeChild); tr.Synonyms.Add(synonym); } } return(tr); }