Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Filtering with xsl on more parameters

From: peter.dewitte@-----.---
To: NULL
Date: 11/21/2008 7:23:00 AM
Hy dudes,

I have a small problem and I doesn't see directly a solution to it. If
you have an XML-file like this:

	<?xml version="1.0" encoding="ISO-8859-1" ?>
	<mainNode>
		<subnode id="id1">
			<someInfo>information_1</someInfo>
		</subnode>
		<subnode id="id2">
			<someInfo>information_2</someInfo>
		</subnode>
		<subnode id="id3">
			<someInfo>information_3</someInfo>
		</subnode>
		<subnode id="id4">
			<someInfo>information_4</someInfo>
		</subnode>
		<subnode id="id5">
			<someInfo>information_5</someInfo>
		</subnode>
	</mainNode>

I want to filter dynamically the information out of subnode with id:
id1 and id3. An other time I will filter the information of subnode
with id: id2, id5 and id3. Is there a way to filter it with xsl,
without adapting your xsl filter. At the moment I filter like this:

	<?xml version="1.0" ?>
	<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/
Transform">
	<xsl:param name="filter">id1</xsl:param>
	<mainNode>
		<xsl:for-each select="mainNode/subnode[$filter]">
		<someInfo><xsl: value-of select="someInfo"/></somInfo>
		</xsl:for-each>
	</mainNode>


The disadvantage in this way of working is that I can only fill in 1
variable, it has to be more... The solution of this problem has to be
dynamically. The use like this <xsl:for-each select="mainNode/subnode
[$filter or $fitlter2 or $filter3]"> isn't good.

Is there enyone who can help me to solve my (little) problem?


Greetz

Peter De Witte
a Belgian student


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent