Example #1
0
        /**
         * This method passes encountered text to the pipeline via the
         * {@link Pipeline#content(WorkerContext, Tag, byte[], ProcessObject)}
         * method.
         */
        virtual public void Text(String text)
        {
            if (text.StartsWith("<![CDATA[") && text.EndsWith("]]>"))
            {
                if (IgnoreCdata())
                {
                    return;
                }
                else
                {
                    text = text.Substring(9, text.Length - 12);
                }
            }
            IWorkerContext ctx = GetLocalWC();

            if (null != ctx.GetCurrentTag())
            {
                if (text.Length > 0)
                {
                    IPipeline     wp = rootpPipe;
                    ProcessObject po = new ProcessObject();
                    try {
                        while (null != (wp = wp.Content(ctx, ctx.GetCurrentTag(), text, po)))
                        {
                            ;
                        }
                    } catch (PipelineException e) {
                        throw new RuntimeWorkerException(e);
                    }
                }
            }
        }
Example #2
0
        /**
         * This method passes encountered text to the pipeline via the
         * {@link Pipeline#content(WorkerContext, Tag, byte[], ProcessObject)}
         * method.
         */
        virtual public void Text(String text)
        {
            IWorkerContext ctx = GetLocalWC();

            if (null != ctx.GetCurrentTag())
            {
                if (text.Length > 0)
                {
                    IPipeline     wp = rootpPipe;
                    ProcessObject po = new ProcessObject();
                    try {
                        while (null != (wp = wp.Content(ctx, ctx.GetCurrentTag(), text, po)))
                        {
                            ;
                        }
                    } catch (PipelineException e) {
                        throw new RuntimeWorkerException(e);
                    }
                }
            }
        }