Hi, everyone:
Here is a simplified version of my source xml document:
<eml>
<additionalMetadata>
<describes>sbclter.380</describes>
<access authSystem="knb" order="denyFirst">
<allow>
<principal>public</principal>
<permission>all</permission>
</allow>
</access>
</additionalMetadata>
<additionalMetadata>
<describes>sbclter.415</describes>
<describes>sbclter.380</describes>
<access authSystem="knb" order="allowFirst">
<allow>
<principal>public</principal>
<permission>all</permission>
</allow>
</access>
</additionalMetadata>
<additionalMetadata>
<describes>sbclter.415</describes>
<access authSystem="knb" order="allowFirst">
<allow>
<principal>public</principal>
<permission>all</permission>
</allow>
</access>
</additionalMetadata>
<eml>
I want to select a node set of element "describes" - its value shows in more than one addtionalMetadata block and its "access" sibling has different order: "denyFirst" and "allowFirst".
In above example, the "describes" with value sbclter.380 is the case. Since it shows in two additionalMetadata block, the first one has "denyFirst" in access sibling, but the second one has "allowFirst" in access sibling. sbclter.415 would NOT be the case. Since it shows up in two additionalMetadata block, but both access siblings has the same value "allowFirst" at the attribute "order".
After transformation, i want get:
<eml>
<additionalMetadata>
<describes>sbclter.380</describes>
<access authSystem="knb" order="denyFirst">
<allow>
<principal>public</principal>
<permission>all</permission>
</allow>
</access>
</additionalMetadata>
<additionalMetadata>
<describes>sbclter.380</describes>
<access authSystem="knb" order="allowFirst">
<allow>
<principal>public</principal>
<permission>all</permission>
</allow>
</access>
</additionalMetadata>
<additionalMetadata>
<access authSystem="knb" order="allowFirst">
<allow>
<principal>public</principal>
<permission>all</permission>
</allow>
</access>
</additionalMetadata>
<eml>
Here is my node:
<xsl:for-each select="/*/*">
<xsl:choose>
<xsl:when test="name()='additionalMetadata'">
<xsl:call-template name="handle-describe-access-in-additional-metadata">
<xsl:with-param name="describes-list" select="./describes[//additionalMetadata[describes = . and access[@order='allowFirst']] and //additionalMetadata[describes = . and access[@order='denyFirst']]]"
></xsl:with-param>
></xsl:with-param>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:for-each>
However,it doesn't work. The xpath in "xsl:with-param" picked up nothing - no sbclter.415 either sbclter.380. Do you have any suggestion? Thank you so much!
Note: this is simplified version of code.