Subject: Re: [xsl] How do I pass the mode as a string? From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Tue, 3 Mar 2020 12:17:57 -0000 |
Normally I would specify apply-template's mode as a literal, eg: <x:apply-templates mode="inputs" />
I have a number of instances of similar code which need to have different modes, eg: <x:apply-templates mode="outputs" />
I'd like to extract all of this into a separate block that I will call with these two values.
<x:variable name="match-mode" >inputs</x:variable> <x:apply-templates mode="$match-mode" />
Doesn't work. Saxon reports: Static error at x:apply-templates on line 47 column 74 of xxx.xsl: XTSE0020: Mode name {$match-mode} is not a valid QName
So, I've tried a few options but I suspect there's something important I'm missing about QNames and the mode attribute. Please can someone advise.
The only option do do have in XSLT 3 to set a mode dynamically is to use a static parameter or variable and a shadow attribute so if you have a top level
Of course this only helps if you want to set that parameter before running the complete XSLT.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] How do I pass the mode as, Michael Kay mike@xxx | Thread | Re: [xsl] How do I pass the mode as, Dimitre Novatchev dn |
Re: [xsl] How do I pass the mode as, David Carlisle d.p.c | Date | Re: [xsl] How do I pass the mode as, Kerry, Richard richa |
Month |