Srilak Posted May 24, 2011 Share Posted May 24, 2011 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.