Syntax error on line 2 at column 9 of file:/C:/Users/sg/gpJava/ud/xsl_xpath_jquery/XQuery/Books2.xqy near {....xml")/books/book return if...}
XPST0003: Unrecognized node constructor if{}
Static error(s) in query
for $x in doc("Books.xml")/books/book
return if($x/@category="XML")then<XMLBOOK>{data($x/title)}</XMLBOOK>
else <NONXML>{data($x/title)}</NONXML>
it worked as above
in eclipse how to create xpy file??(File -->New -->Other has only option to create xml though..do i need separate plug in for this?)
As of now i just imported unzipped folder as existinng project.
then i clicked on the xqy file and run --->run as--->run configuration
there in main
i searched on Query selected
net.sf.saxon.Query
(not sure why it showed same entries two times any way i selected one of them)
In arguments i gave Books2.xpy the same xquery file name i am runing
when i apply and run console gave the result of the filtered data
<?xml version="1.0" encoding="UTF-8"?><NONXML>Master Core Java</NONXML><NONXML>Get Certified in .Net</NONXML><XMLBOOK>XML and XML Schema Definition in easy steps</XMLBOOK><XMLBOOK>XSLT XPATH and XQuery Fundamentals</XMLBOOK> xquery1.png xquery2.png