|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How to do macro substitution in XPath?
On 02/12/2023 16:36, Roger L Costello costello@xxxxxxxxx wrote:
Hi Folks,Baines Johnson (LBJ)), then Moses (RM)), then
xsl:value-of element. Notice the use of XML ENTITIES. to stick with pure XPath. What XPath do you recommend? 'Robert A. Caro'))"> <!ENTITY RM "((/Book/Title eq 'Power Broker') and (/Book/Author eq'Robert A. Caro'))"> version="3.0">]> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" You ca do the following using static parameters and shadow attributes:
B B B <xsl:param name="LBJ" as="xs:string" static="yes" select="'((/Book/Title eq ''Path to Power'') and (/Book/Author eq ''Robert A. Caro''))'"/> B B B <xsl:param name="RM" as="xs:string" static="yes" select="'((/Book/Title eq ''Power Broker'') and (/Book/Author eq ''Robert A. Caro''))'"/> B B B <xsl:template match="/">
B B B B B B B <xsl:value-of _select="
B B B B B B B B B B B if {$LBJ} then
B B B B B B B B B B B B B B B 'action 1'
B B B B B B B B B B B else if {$RM} then
B B B B B B B B B B B B B B B 'action 2'
B B B B B B B B B B B else if (not(({$LBJ}) or ({$RM}))) then
B B B B B B B B B B B B B B B 'action 3'
B B B B B B B B B B B else
B B B B B B B B B B B B B B B 'Error'
B B B B B B B B B B B "/>
B B B </xsl:template>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








