Srilak 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now