|
Subject: Re: [xsl] filter using contains with multiple values From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Fri, 4 Mar 2016 11:38:51 -0000 |
okay got that point (parenthesis). But still that does not work for me since somehow the string in filter_value is not understood as sequence! So if I now use:
<xsl:if test="*[name()= $filter and . = $filter_value]b>
or as Michael suggested
<xsl:if test="*[name()= $filter][. = $filter_value]b>
it only matches the first of the two in the sequence if I use
<xsl:param name="filter_value" as="xs:string*" select="'Log', bInfo'b/>
to pass the parameter! Even an:
<xsl:value-of select=b$filter_valueb/>
only returns: bLogb where I would expect it to return the whole parameter! I seem to still miss some crucial point in making filter_value being understood as sequence here!?
<xsl:param name="filter" as="xs:string" select="'keyword'"/> <xsl:param name="filter_values" as="xs:string*" select="'Log', 'Info'"/>
<xsl:template match="/">
<xsl:copy-of select="//*[name() = $filter and . = $filter_values]"/>
</xsl:template><list>
<entry>
<keyword>Log</keyword>
<location>A</location>
</entry>
<entry>
<keyword>Log</keyword>
<location>B</location>
</entry>
<entry>
<keyword>Problem</keyword>
<location>A</location>
</entry>
<entry>
<keyword>Info</keyword>
<location>B</location>
</entry>
</list><xsl:param name="filter" as="xs:string" select="'keyword'"/> <xsl:param name="filter_values" as="xs:string*" select="'Log', 'Info'"/>
<list>
<entry>
<keyword>Log</keyword>
<location>A</location>
</entry>
<entry>
<keyword>Log</keyword>
<location>B</location>
</entry>
<entry>
<keyword>Problem</keyword>
<location>A</location>
</entry>
<entry>
<keyword>The newest Info</keyword>
<location>B</location>
</entry>
</list>| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] filter using contains wit, Graydon graydon@xxxx | Thread | Re: [xsl] filter using contains wit, Raimund Kammering ra |
| Re: [xsl] filter using contains wit, Graydon graydon@xxxx | Date | Re: [xsl] Table structure checking,, Nigel Whitaker nigel |
| Month |