[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

SV: Question about data filter using XSLT

Subject: SV: Question about data filter using XSLT
From: "Per Osnes" <per.osnes@xxxxxx>
Date: Tue, 14 Nov 2006 13:23:32 +0100
filter in xslt
Your XML seems to be corrupt:
 <text>Condition 1</height>

If you use this XML:
    <text>Condition 1</text>
      <text>Condition 2</text>
      <img src=""></img>

the following XSLT outputs the contents of the <text> child of the listX
node matching the color parameter:

 <xsl:param name="color" select="'white'"/> <!-- input parameter -->

 <xsl:template match="*[starts-with(name(),'list')]">
   <xsl:if test="color/text()=$color">
      <xsl:value-of select="text"/>
    <xsl:apply-templates select="*[starts-with(name(),'list')]"/>

By introducing more parameters + extending the xsl:if and modifying the
xsl:value you hopefully will achieve what you want.

 - Per.

-----Opprinnelig melding-----
Fra: ms [mailto:mina_hurray@xxxxxxxxx] 
Sendt: 13. november 2006 17:28
Til: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Emne:  Question about data filter using XSLT


I am passing three paramters to my XSLT and based on
these paramters and the corresponsing conditions on
the XML, only the data corresponsing to these
paramters should be displayed.


I have height, weight, color as three parameters which
I pass on th style sheet.

Now, in the actual content (the XML), these paramters
are present as well:

 <text>Condition 1</height>
  <text>Condition 2</text>
<img src=""/>

Now suppose the paramters height, width and color
passed on style sheet have values 2,4 and white then
only content of <list2> and image associated with it
should be displayed. 

How can this be achieved on the style sheet? I ahev
tried passing parameters at template levels but it
does not work. Please do give me some ideas. Thanks in
advance for all your help.

Cheap talk?
Check out Yahoo! Messenger's low PC-to-Phone call rates.

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.