Joining tables using FLWOR

tkj_jmj

New Member
I have a question regarding FLWOR joins. Here's an overview of how my XMLs look like.\[code\]<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>\[/code\]I have a FLWOR expression, query, which should return a sequence of permissions for a given user. It should be simple enough, however I can't figure out why I'm getting an empty ResourceSet every time run the query.\[code\]for $i in collection("data/rbac/users")/user[user-id="..."]/role-idfor $j in collection("data/rbac/roles")/roles/rolefor $k in collection("data/rbac/permissions")/permissionwhere $i = $j/role-id and exists($j/permission-id[. = $k/permission-id])return $k\[/code\]Any suggestion is much appreciated.Thanks,Igor
 
Back
Top