如何使用 XSLT 获取表中的行值
我需要帮助来使用 xslt 使用另一个行值从表中检索行值。
我有一张表如下:
Employee Manager
ABC PQR
ABC LMN
DEF XYZ
IJK XYZ
员工可以属于多个部门,并且可以有多个经理。
该表的 xml 为:
<List>
<Mapping>
<Employee>ABC</Employee>
<Manager>PQR</Manager>
</Mapping>
<Mapping>
<Employee>ABC</Employee>
<Manager>LMN</Manager>
</Mapping>
<Mapping>
<Employee>DEF</Employee>
<Manager>XYZ</Manager>
</Mapping>
...
</List>
我从函数中获取员工姓名。使用员工姓名作为 XSLT 中的输入,我应该如何使用 XSLT 查找员工的经理姓名。我唯一的输出值应该是经理名称,可以是列表或单个值。传递“ABC”员工姓名应该给我“PQR”和“LMN”作为经理值。
谢谢 KSR81
I need help in using xslt to retrieve a row value from a table using another row value.
I have a table as follows:
Employee Manager
ABC PQR
ABC LMN
DEF XYZ
IJK XYZ
Employee can belong to more than one department and can have more than one manager.
and the xml for the table is:
<List>
<Mapping>
<Employee>ABC</Employee>
<Manager>PQR</Manager>
</Mapping>
<Mapping>
<Employee>ABC</Employee>
<Manager>LMN</Manager>
</Mapping>
<Mapping>
<Employee>DEF</Employee>
<Manager>XYZ</Manager>
</Mapping>
...
</List>
I get the employee name from a function. Using employee name as input in XSLT, how should i find the employee's manager name using XSLT. My only output value should be the Manager Name either a list or single value. Passing "ABC" employee name should give me both "PQR" and "LMN" as manager values.
Thanks
KSR81
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这将输出给定员工的每个经理的姓名,以空格分隔和终止。
为了更有效地做到这一点,您可能需要使用键:
This will output the name of each manager for the given employee, separated and terminated by a space.
To do this more efficiently, you will probably want to use keys:
请在此处查看更多,以及使用参数此处?
Check here for more, and working with parameters here?