Examples of XMLOutput


Examples of org.apache.commons.jelly.XMLOutput

      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

Examples of org.apache.commons.jelly.XMLOutput

             // (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

Examples of org.apache.commons.jelly.XMLOutput

     */
    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

Examples of org.apache.commons.jelly.XMLOutput

             // (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

Examples of org.apache.commons.jelly.XMLOutput

        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

Examples of org.apache.commons.jelly.XMLOutput

        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

Examples of org.apache.commons.jelly.XMLOutput

            value = reader.parse( url.toString() );
        }
        else {

            // invoke the body and pass that into the reader
            XMLOutput newOutput = new XMLOutput( reader );
           
            invokeBody(newOutput);
           
            value = reader.getRoot();
        }
View Full Code Here

Examples of org.apache.commons.jelly.XMLOutput

            // now install the current output in the filter chain...
            // ####
           
            ContentHandler handler = filter.getContentHandler();
            handler.startDocument();
            invokeBody( new XMLOutput( handler ) );
            handler.endDocument();
            valid = filter.isValid();           
        }
        else {
          // outputting the errors to the current output
          verifier.setErrorHandler(
              new ErrorHandler() {
                  public void error(SAXParseException exception) throws SAXException {
                      outputException(output, "error", exception);
                  }
                 
                  public void fatalError(SAXParseException exception) throws SAXException {
                      outputException(output, "fatalError", exception);
                  }
                 
                  public void warning(SAXParseException exception) throws SAXException {
                      outputException(output, "warning", exception);
                  }
              }
          );
 
          VerifierHandler handler = verifier.getVerifierHandler();    
            handler.startDocument();
          invokeBody( new XMLOutput( handler ) );
            handler.endDocument();
            valid = handler.isValid();           
        }
        handleValid(valid);
    }
View Full Code Here

Examples of org.apache.commons.jelly.XMLOutput

    /**
     * Parses the body of this tag and returns the parsed document
     */
    protected Document parseBody(XMLOutput output) throws Exception {
        SAXContentHandler handler = new SAXContentHandler();
        XMLOutput newOutput = new XMLOutput(handler);
        handler.startDocument();
        invokeBody( newOutput);
        handler.endDocument();
        return handler.getDocument();

View Full Code Here

Examples of org.apache.commons.jelly.XMLOutput

    //-------------------------------------------------------------------------
    public void doTag(final XMLOutput output) throws Exception {
        if ( name == null ) {
            throw new MissingAttributeException( "name" );
        }
        XMLOutput newOutput = createXMLOutput();
        try {
            newOutput.startDocument();
            invokeBody(newOutput);
            newOutput.endDocument();
        }
        finally {
            newOutput.close();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.