我有一个关于 FLWOR 连接的问题。这是我的 XML 外观的概述。
<user>
<user-id>...</user-id>
<username>...</username>
<password>...</password>
<!-- By schema file, there could be unbounded role-ids -->
<role-id>...</role-id>
<role-id>...</role-id>
<role-id>...</role-id>
</user>
<role>
<role-id>...</role-id>
<name>...</name>
<!-- By schema file, there could be unbounded permission-ids -->
<permission-id>...</permission-id>
<permission-id>...</permission-id>
<permission-id>...</permission-id>
</role>
<permission>
<permission-id>...</permission-id>
<resource-id>...</resource-id>
<operation-id>...</operation-id>
</permission>
我有一个 FLWOR 表达式查询,它应该返回给定用户的一系列权限。它应该很简单,但是我无法弄清楚为什么每次运行查询时都会得到一个空的 ResourceSet。
for $i in collection("data/rbac/users")/user[user-id="..."]/role-id
for $j in collection("data/rbac/roles")/roles/role
for $k in collection("data/rbac/permissions")/permission
where $i = $j/role-id and exists($j/permission-id[. = $k/permission-id])
return $k
任何建议都非常感谢。谢谢,
伊戈尔