Package org.apache.commons.jelly

Examples of org.apache.commons.jelly.XMLOutput


            throw new IllegalStateException
              ("Attribute \"ldapContext\" must be specified.");
        }
        try {
            HandlerStack handler = new HandlerStack(new ContentHandler ());
            getXML (new XMLOutput(handler.contentHandler()));
        } catch (SAXException e) {
            throw new JellyTagException(e.getException());
        }
    }
View Full Code Here


            throw new IllegalStateException
              ("Attribute \"ldapContext\" must be specified.");
        }
        try {
            HandlerStack handler = new HandlerStack(new ContentHandler ());
            getXML (new XMLOutput(handler.contentHandler()));
        } catch (SAXException e) {
            throw new JellyTagException(e.getException());
        }
    }
View Full Code Here

            throw new IllegalStateException
              ("Attribute \"ldapContext\" must be specified.");
        }
        try {
            HandlerStack handler = new HandlerStack(new ContentHandler ());
            getXML (new XMLOutput(handler.contentHandler()));
        } catch (SAXException e) {
            throw new JellyTagException(e.getException());
        }
    }
View Full Code Here

    /**
     * Simple parsing test
     */
    public void runScript() throws Exception {
  JellyContext context = new JellyContext();
  XMLOutput xmlOutput = XMLOutput.createXMLOutput(System.out);
  context.runScript(new File ("util/test.jelly"), xmlOutput);
  xmlOutput.flush();
    }
View Full Code Here

      seb.emit (new NamespaceAttributesFilter(jellyParser));
      Script script = jellyParser.getScript ();
      script.compile ();
      SAXEventBufferImpl jres = new SAXEventBufferImpl ();
      jres.startDocument ();
      script.run (context, new XMLOutput(jres));
      jres.endDocument ();
      jres.pack ();
      return jres;
  } catch (JellyException e) {
      throw (IllegalArgumentException)(new IllegalArgumentException
View Full Code Here

             // (from sitemap parameters) will be overriden, if same variables are
             // supplied through the request object.
            this.updateContext();

            // Execute Jelly script
            XMLOutput xmlOutput = new XMLOutput(this.contentHandler, this.lexicalHandler);
           
            // TODO - Compile the script and cache the compiled version
           
            scriptSource = this.resolver.resolveURI(this.source);
           
            Script script = this.jellyParser.parse(SourceUtil.getInputSource(scriptSource));
            script = script.compile();
           
            // the script does not output startDocument/endDocument events
            this.contentHandler.startDocument();
            script.run(this.jellyContext, xmlOutput);
            xmlOutput.flush();
            this.contentHandler.endDocument();
           
        } catch (IOException e) {
            getLogger().error("JellyGenerator.generate()", e);
            throw new ResourceNotFoundException("JellyGenerator could not find resource", e);
View Full Code Here

     */
    protected void initializeRootContext()
        throws IOException
    {
        this.writer = new OutputStreamWriter( System.out );
        XMLOutput output = XMLOutput.createXMLOutput( writer, false );

        if ( getCli().hasOption( WORKING_DIR ) )
        {
            String workingDir = getCli().getOptionValue( WORKING_DIR );
            File dir = new File( workingDir );
View Full Code Here

             // (from sitemap parameters) will be overriden, if same variables are
             // supplied through the request object.
            this.updateContext();

            // Execute Jelly script
            XMLOutput xmlOutput = new XMLOutput(this.contentHandler, this.lexicalHandler);
           
            // TODO - Compile the script and cache the compiled version
           
            scriptSource = this.resolver.resolveURI(this.source);
           
            Script script = this.jellyParser.parse(SourceUtil.getInputSource(scriptSource));
            script = script.compile();
           
            // the script does not output startDocument/endDocument events
            this.contentHandler.startDocument();
            script.run(this.jellyContext, xmlOutput);
            xmlOutput.flush();
            this.contentHandler.endDocument();
           
        } catch (IOException e) {
            getLogger().error("JellyGenerator.generate()", e);
            throw new ResourceNotFoundException("JellyGenerator could not find resource", e);
View Full Code Here

        Script script = parser.parse(in);
        script = script.compile();
        JellyContext context = parser.getContext();
       
        SAXContentHandler contentHandler = new SAXContentHandler();
        XMLOutput output = new XMLOutput( contentHandler );
       
        contentHandler.startDocument();
        script.run(context, output);
        contentHandler.endDocument();
       
View Full Code Here

        Script script = (Script) data.get( "jelly.script" );

        JellyContext jellyContext = (JellyContext) data.get( "jelly.context" );

        XMLOutput    output       = (XMLOutput) data.get( "jelly.output" );

        try
        {
            script.run( jellyContext,
                        output );
            output.flush();
        }
        catch (Exception e)
        {
            e.printStackTrace();
            throw new JobExecutionException( e,
View Full Code Here

TOP

Related Classes of org.apache.commons.jelly.XMLOutput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.