Jump to content

Parse XQuery for Predicates -- help! :(


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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...