输入 XML
<Employer>
<Employeedetail>Sam SR Engineer 10%</ Employeedetail >
<Employeedetail>Sam SR 10%</ Employeedetail >
<Employeedetail>Sam SR</ Employeedetail >
</ Employer >
下面是输出输入 XML
<Employer>
< Employeedetails >
< Employeedetail1>
< Employeedetail >
<Name>Sam</ Name >
<Grade> SR Engineer </ Grade >
<Experience>10</ Experience >
</ Employeedetail >
</ Employeedetail1>
</ Employeedetails>
</ Employer >
<Employer>
< Employeedetails >
< Employeedetail1>
< Employeedetail >
<Name>Sam</ Name >
<Grade>SR</ Grade >
<Experience>10</ Experience >
</ Employeedetail >
</ Employeedetail1>
</ Employeedetails>
</ Employer >
<Employer>
< Employeedetails >
< Employeedetail1>
< Employeedetail >
<Name>Sam</ Name >
<Grade>SR</ Grade >
<Experience>10</ Experience >
</ Employeedetail >
</ Employeedetail1>
</ Employeedetails>
</ Employer >
如果我们有三个空间分散的节点,他们会帮助堆栈溢出的人,我们将获得输出
但是,如果您查看 Sr Engineer 等级,这将再次进入等级,但我所拥有的代码将在 Grade 元素中显示 SR,而 Engineer 和 10(经验)将在 Experience 元素中出现。
如果没有经验值,则默认为 10。
在上面的输入 XML 中,将会有许多员工详细信息。
请帮忙解答上述问题
提前致谢