日期:2014-05-20  浏览次数:20353 次

XML读取节点属性
<?xml   version= "1.0 "   encoding= "gb2312 "?>  
<processes>  
<process   id= "leave "   name= "请假申请批准流程 ">  
<activity   id= "start "   name= "开始 ">  
<nextActivity   id= "apply "/>  
</activity>  
<activity   id= "apply "   name= "申请 ">  
<nextActivity   id= "dept_manager_approve "/>  
</activity>  
<activity   id= "dept_manager_approve "   name= "部门经理审批 ">  
<nextActivity   id= "general_manager_approve "   driveType= "manual "/>  
<nextActivity   id= "human_resource_record "   driveType= "manual "/>  
</activity>  
<activity   id= "general_manager_approve "   name= "总经理审批 ">  
<nextActivity   id= "human_resource_record "/>  
</activity>  
<activity   id= "human_resource_record "   name= "人力资源部备案 ">  
<nextActivity   id= "end "/>  
</activity>  
<activity   id= "end "   name= "结束 ">  
</activity>  
</process>  
</processes>  
如果用这种方法,只是显示出各个节点属性的值,没有逻辑判断,我想通过一步一步判断显示出逻辑关系,但是不知道语句怎么写,初学,请教大家,帮个忙?
  protected   void   Page_Load(object   sender,   EventArgs   e)
        {      
                XmlDocument   xdoc   =   new   XmlDocument();
                xdoc.Load(Server.MapPath( "请假.xml "));
                XmlNodeList   nl   =   xdoc.SelectNodes( "//activity ");
               
                {
                        string   str   =   " ";
                for   (int   i   =   0;   i   <   nl.Count;   i++)
                {
                        str=   nl[i].Attributes[ "id "].Value   ;
                        Label   lb   =   new     Label();
                        lb.Text   =   str;
                        Response.Write(lb.Text   + "-> ");
                     

                }
                }
        }

------解决方案--------------------
你想做工作流引擎? 用google查查资料吧。
------解决方案--------------------
不是每个Activity都有相应的NextActivity子节点么?
通过这个来连接