Example #1
0
        private static String MakeProperty(EsperEPL2GrammarParser.EventPropertyAtomicContext ctx, String defaultNamespacePrefix)
        {
            String prefix = "";

            if (defaultNamespacePrefix != null)
            {
                prefix = defaultNamespacePrefix + ":";
            }

            String unescapedIdent = ASTUtil.UnescapeDot(ctx.eventPropertyIdent().GetText());

            if (ctx.lb != null)
            {
                int index         = IntValue.ParseString(ctx.number().GetText());
                int xPathPosition = index + 1;
                return('/' + prefix + unescapedIdent + "[position() = " + xPathPosition + ']');
            }

            if (ctx.lp != null)
            {
                String key = StringValue.ParseString(ctx.s.Text);
                return('/' + prefix + unescapedIdent + "[@id='" + key + "']");
            }

            return('/' + prefix + unescapedIdent);
        }