OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Xpath & conditional filters

[ Lists Home | Date Index | Thread Index ]

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




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS