Re: [xsl] XML access control by custom ID

Subject: Re: [xsl] XML access control by custom ID
From: "Imsieke, Gerrit, le-tex" <gerrit.imsieke@xxxxxxxxx>
Date: Tue, 16 Mar 2010 09:44:03 +0100
Dear Jacobus,

If you substitute 'users' with 'root' in the stylesheet, the example will work.

xsl:key works as follows here: given the string 'anybody--1', the xsl:key function will return any my_id (below the root node of access.xml) whose value (calculated according to the use attribute of the xsl:key element) is 'anybody--1'. Then it will go up one level from there and return the name(s) of the elements specifying the type of right (read, write) as a sequence of strings. This sequence (in the current example, it's only one item, 'read'), concatenated by space, will constitute the access attribute of the data element whose id is 1 (for the current user, which is anybody).

Gerrit


On 16.03.2010 09:09, Jacobus Reyneke wrote:
-----------Your stylesheet:--------
  <xsl:template match="users/*"/><!-- ignore by default -->

  <!-- process accessible nodes: copy and add @access -->
  <xsl:template match="users/*[ @my_id = $accessible ]" priority="1">

Current Thread