XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Glenn MeadowsSubject: XSLT Conditional Statements
Author: Glenn Meadows
Date: 21 Aug 2006 05:15 PM
I have a XML file and a XSLT file. I created the XSLT file from a HTML file.

My XML file (discussion.xml) has a discussion tag and a rfinumber tag in addition to a few other tags.

I placed a table in my WYSIWYG view and placed the discussion tag into the table and made it repeating. When viewed, each discussion from discussion.xml is placed in the table.

What I would like to do is to put only the discussion tags for a given rfinumber using some sort of conditional expression.

Finally, how can I pass the rfinumber to a XSLT page programmatically. This way I can pass the rfinumber and have my page pop up listing only the discussions with a given rfinumber.


Documentdiscussion.xml
XML

UnknownRFIReport.htm
HTML

Unknownrfireport.xsl
XSLT

Posttop
Ivan PedruzziSubject: XSLT Conditional Statements
Author: Ivan Pedruzzi
Date: 22 Aug 2006 04:16 PM

Hi Glenn,

To define a parameter you have to use something like the following
<xsl:param name="rfinumber"/>

then you can re-write the for-each as follow

<xsl:for-each select="dataroot/discussion[$rfinumber = rfinumber]">

All major XSLT processor offer an API to bind a parameter value given the parameter name.

Hope this helps
Ivan Pedruzzi
Stylus Studio Team

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.