Jump to content

Parse XQuery for Predicates -- help! :(


Srilak
 Share

Recommended Posts

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 by Srihari
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...