Permalink
Browse files

Simple script for parse and evaluate XQuery

  • Loading branch information...
1 parent 2cfaa91 commit ec990b7a25e9abe99a54beda89130ed61190b7b8 @bacek committed Dec 16, 2008
Showing with 18 additions and 0 deletions.
  1. +18 −0 p.pl
View
18 p.pl
@@ -0,0 +1,18 @@
+use v6;
+use Data::Dumper;
+use XQuery::Parser::Grammar;
+use XQuery::DynamicContext;
+use XQuery;
+
+say @*ARGS[0];
+my $filename = @*ARGS[0];
+my $content = slurp $filename;
+my $core = XQuery::parse($content);
+$core.dump;
+
+my $dc = XQuery::DynamicContext.new();
+
+my @res = $core.evaluate($dc);
+
+say "result: " ~@res;
+

0 comments on commit ec990b7

Please sign in to comment.