how to copy attribute XML node to specified structure or array

Posted by jozi on Stack Overflow See other posts from Stack Overflow or by jozi
Published on 2010-04-04T15:43:36Z Indexed on 2010/04/04 15:53 UTC
Read the original article Hit count: 433

Filed under:
|

how to copy attribute XML node to specified structure or array with one command for example

    public struct PossibilityJavamed
    {
        public string derv;
        public string dervt;
        public string num;
        public string gend;
    }
PossibilityJavamed tmpstructnew = tmpstruct;
ArrayList alstout = new ArrayList();
XmlNodeList nodeList;
nodeList = docHarf.SelectNodes("//adatesmi");
            for (int i = 0; i < nodeList.Count; i++)
            {


                    tmpstructnew.derv = nodeList[i].Attributes["derv"].Value;
                    tmpstructnew.dervt = nodeList[i].Attributes["dervt"].Value;
                    tmpstructnew.num = nodeList[i].Attributes["num"].Value;
                    tmpstructnew.gend = nodeList[i].Attributes["gend"].Value;
                    alstout.Add(tmpstructnew);
            }

but i will do it in one command

© Stack Overflow or respective owner

Related posts about c#

Related posts about Xml