Jump to content

Boolean expression parser


Guest aresot

Recommended Posts

Guest aresot

Is there XML standard or subset to define and parse complex boolean expressions in XML format?Instead of me parsing "var1=23 or (var2<45 and var3='abc' and (var4='dd' or var5=45))" to have more XMLised format like:<name="var1" op="eq" value="23"><or/><parenthensis> <name="var2" op="lt" value="45"><and/> <name="var3" op="eq" value="abc"><and/> <parenthensis> <name="var4" op="eq" value="dd><or/> <name="var5" op="eq" value="45> </parenthensis></parenthensis>Thank you.

Link to comment
Share on other sites

Well, it kind'a depends.MathML is used to markup math data in XML format, which feels like what you want.If those expressions will be part of an XPath/XQuery expression, you can use XQueryX, however be advised that due to XQuery's huge capabilities, XQueryX can get very verbose on even the simplest queries.In the worst case, you can create XSLT stylesheet that would turn your XML above into another XSLT or whatever you want the code for and then use the output.

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
×
×
  • Create New...