Knowledge Partner
Knowledge Partner
217 views

AU4 prompt stylesheet update

AU4 includes a new version of the GCV prompt stylesheets that now handles list
type GCVs properly. But it looks like it would break something else, if I'm not
mistaken. The old version of the stylesheet had:

<!-- pre-populate prompts with existing values -->
<xsl:template
match="definition/value[not(ancestor::definition/@type='structured')]">
<xsl:variable name="name" select="../@name"/>
<xsl:variable name="curVal">
<xsl:choose>
<xsl:when test="$curDoc//ds-value[../@ds-attr-name=$name]/text()">
<xsl:value-of select="$curDoc//ds-value[../@ds-attr-name=$name]/text()"/>
</xsl:when>
<xsl:otherwise>
*<xsl:value-of select="$curDoc//value[../@name=$name]/text()"/>*
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<!-- backfilling from current value -->
<xsl:when test="$curVal">
*<value>*
*<xsl:value-of select="$curVal"/>*
*</value>*
</xsl:when>
<!-- no current value found -->
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

while in AU4 this got changed to:

<!-- pre-populate prompts with existing values -->
<xsl:template
match="definition/value[not(ancestor::definition/@type='structured')]">
<xsl:variable name="name" select="../@name"/>
<xsl:variable name="curVal">
<xsl:choose>
<xsl:when test="$curDoc//ds-value[../@ds-attr-name=$name]/text()">
<xsl:value-of select="$curDoc//ds-value[../@ds-attr-name=$name]/text()"/>
</xsl:when>
<xsl:otherwise>
*<xsl:copy-of select="$curDoc//value[../@name=$name]"/>*
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<!-- backfilling from current value -->
<xsl:when test="$curVal">
*<xsl:copy-of select="$curVal"/>*
</xsl:when>
<!-- no current value found -->
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

So now when setting the variable $curVal, the "otherwise" clause set it to a
nodeset of <value> nodes instead of a text value, which allows list type GCVs
containing <item> subnodes to be backfilled properly, because in the backfill
part, the code has been changed to a xsl:copy instead of the former
xsl:value-of. Fine so far.

But what if the "when" clause for setting $curVar gets selected? $curVar will
contain text, not a nodeset of <value> nodes and the new backfilling code will
mess up the prompt, I suspect.

On the other hand: does it ever get selected? Does anyone know what use case is
covered by <xsl:when test="$curDoc//ds-value[../@ds-attr-name=$name]/text()">?

--
______________________________________________________________________
http://www.is4it.de/en/solutions/identity-access-management

(If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below...)
______________________________________________
https://www.is4it.de/identity-access-management
Labels (1)
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.