예제 #1
0
        protected YExample GetYExample(XmlElement node)
        {
            YExample example = new YExample
            {
                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")
                {
                    example.Example = nodeChild.InnerText;
                }
                if (nodeChild.LocalName == "tr")
                {
                    foreach (XmlElement nodeExTr in nodeChild.ChildNodes)
                    {
                        if (nodeExTr.LocalName == "text")
                        {
                            example.ExampleTranslation = nodeExTr.InnerText;
                        }
                    }
                }
            }
            return(example);
        }
예제 #2
0
        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);
        }