Subject: RE: [xsl] Comparing Node Text Content with a String Set From: Jarno.Elovirta@xxxxxxxxx Date: Tue, 28 Oct 2003 09:36:24 +0200 |
Hi, > ie.. instead of having the following <if test> syntax > all through my multiple xslt files: > > <xsl:if test="ACCTTYPE = 'AAA' or > ACCTTYPE = 'BBB' or > ACCTTYPE = 'CCC' or > ACCTTYPE = 'DDD' or > ACCTTYPE = 'EEE'"> > > I am curious if there is a way to define this once in > a common xslt file which is then imported into my many > xslt files, so if new types are added or removed, it > only has to be changed once? The template that contains the test, you can put that into a named template and xsl:import that stylesheet. Create a file that contains the types, e.g. <types> <type>AAA</type> <type>BBB</type> <type>CCC</type> <type>DDD</type> </types> and in your stylesheet test it with <xsl:if test="document('test.xml')/types/type = ACCTTYPE"> … </xsl:if> Cheers, Jarno XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Comparing Node Text Conte, Michael Kay | Thread | RE: [xsl] Comparing Node Text Conte, Passin, Tom |
RE: [xsl] Selecting the first sente, Jarno . Elovirta | Date | RE: [xsl] Do a copy of a document b, Lenz, Georg |
Month |