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

Xpath & conditional filters


xpath isnull
Hi ,
 
I have a XPath question hopefully someone can
help me out with.  I want to query a XML document
- sometimes I want to filter by a particular
attribute other times I want to ignore the filter
completely in SQL I would code it something like
this
 
    Select tbl.Field1, tbl.Field2
    From myTable tbl
    Where    
    AND tbl.Field1= ISNULL(@Filter_ID,tbl.Field1)
    AND tbl.Field2=
ISNULL(@Filter_ID2,tbl.Field1)(@Filter_ID2,tbl.Field2)
 
 
I only want to write one xpath query for this the
question is how do I do this when quering my XML
Document in my XSLT stylesheet?


So in if I had a xml doc like below I would
either want to ignore the filter (if it is null) 
or filter on the value of a variable.

<myTable>
            <row Field1="1" Field2="Row 1"/>
            <row Field1="2" Field2="Row 2"/>
            <row Field1="3" Field2="Row 3"/>
</myTable>
 
Thanks

David


__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.