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
    Select tbl.Field1, tbl.Field2
    From myTable tbl
    AND tbl.Field1= ISNULL(@Filter_ID,tbl.Field1)
    AND 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.

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


Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts


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

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