Srilak 0 Posted May 24, 2011 Report Share Posted May 24, 2011 (edited) Hi all,I am new to XML and XQuery. I would like to extract the predicates from a given Xquery. Is there any parser that would parse the XQuery and return me the predicates in it. Or any other approach that would help me do that?. For example, XQuery: for $x in distinct-values(//factdoc/fact/dimension[@dim-id=Part]/@value), $y in //dimensions/Level[@id=Part]/instance $z in //dimensions[@dim_id=Customer]/Level[@id=Nation]/instance let $q := sum(//factdoc/fact[dimension[@dim-id=Part]/@value=$y/@id]/measure[@mes-id=f_quantity]/@value) where $y/attribute[@id=p_retailprice]/@value <= 1000 and $z/attribute[@id=n_name]/@value='FRANCE' Predicates as Output:p_retailprice <=1000n_name=FRANCE (or)return the statements which contain the predicates like, where $y/attribute[@id=p_retailprice]/@value and $z/attribute[@id=n_name]/@value='FRANCE'Thanks,SriHari Edited May 24, 2011 by Srihari Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.