Package de.danet.an.workflow.util

Examples of de.danet.an.workflow.util.SAXEventBufferImpl


     */
    public DefaultProcessDefinition (Document processDefinition)
  throws JDOMException, ImportException {
  try {
      SAXOutputter outputter = new SAXOutputter();
      procDef = new SAXEventBufferImpl ();
      outputter.setContentHandler(procDef);
      outputter.setLexicalHandler(procDef);
      outputter.output (processDefinition);
  } catch (JDOMException e) {
      String s = "Cannot get XPDL from DOM: " + e.getMessage();
View Full Code Here


    reader = parser.getXMLReader();
      } catch (SAXException e) {
    SAXParser parser = pf.newSAXParser();
    reader = new XmlnsUrisPatcher (parser.getXMLReader());
      }
      procDef = new SAXEventBufferImpl ();
      reader.setContentHandler(procDef);
      // Parse the file
      InputSource inSrc = new InputSource(new StringReader(xpdl));
      reader.parse (inSrc);
      init ();
View Full Code Here

  return null;
    }

    private void subtreeToSAX (Element e, ContentHandler h) {
  try {
      SAXEventBufferImpl buf = new SAXEventBufferImpl ();
      SAXOutputter out = new SAXOutputter (buf);
      out.output(new Document((Element)e.clone()));
      HandlerStack hs = new HandlerStack (h);
      buf.emit (hs.contentHandler());
  } catch (JDOMException ex) {
      throw new IllegalArgumentException (ex.getMessage ());
  } catch (SAXException ex) {
      throw new IllegalArgumentException (ex.getMessage ());
  }
View Full Code Here

     * @throws IOException Error reading the XSLT.
     * @throws SAXException
     *         Script error.
     */
    protected void loadScript(String script) throws IOException, SAXException {
        SAXEventBufferImpl buf = loadDocument(script);
       
        getJellyTool().setScript(buf);
    }
View Full Code Here

        File file =  new File(name);
        URL url = file.toURL();
        String systemID = url.toExternalForm();
        StreamSource source = new StreamSource(systemID);

        SAXEventBufferImpl buffer = new SAXEventBufferImpl();
        SAXResult result = new SAXResult(buffer);
        try {
            TransformerFactory factory = TransformerFactory.newInstance();
            Transformer transformer = factory.newTransformer();
            transformer.transform(source, result);
View Full Code Here

      // get processdata
      ProcessData data = process.processContext();
      Object value = data.get("result");
      if (value != null) {
    SAXEventBufferImpl myBuffer
        = (SAXEventBufferImpl)value;
    TransformerFactory tf
        = TransformerFactory.newInstance();
    SAXTransformerFactory saxTransFact = null;
    if (tf.getFeature(SAXTransformerFactory.FEATURE)) {
        saxTransFact = (SAXTransformerFactory)tf;
    }
    TransformerHandler transHand = null;
      transHand = saxTransFact.newTransformerHandler();
      StreamResult streamResult = new StreamResult
          (new java.io.ByteArrayOutputStream());
      transHand.setResult(streamResult);
      myBuffer.emit(transHand);
     System.out.println(streamResult.getOutputStream().toString());

    DOMResult domResult = new DOMResult();
    transHand = saxTransFact.newTransformerHandler();
    transHand.setResult(domResult);
    myBuffer.emit(transHand);
    Element returnResult = ((Document)domResult.getNode())
        .getDocumentElement();
    XPath xpath = new DOMXPath("/parent/firstChild");
    String value2 = xpath.stringValueOf(returnResult);
    assertTrue(value2.equals("I'm number one"));
View Full Code Here

   */
  public void startElement
      (String uri, String loc, String raw, Attributes a)
      throws SAXException {
      if (propName != null) {
    propBuffer = new SAXEventBufferImpl ();
    propBuffer.startDocument ();
    getStack().startAllPrefixMappings (propBuffer);
    getStack().push (propBuffer);
      } else if (loc.equals ("Application")) {
    id = a.getValue("Id");
View Full Code Here

    String returnResult = (String)map.get(name);
    // check testXSLT.xml for the expected result
    assertTrue(returnResult.equals("Matisse, Henri"));
      }
      if (name.equals("complexResult")) {
    SAXEventBufferImpl myBuffer
        = (SAXEventBufferImpl)map.get(name);
    TransformerFactory tf
        = TransformerFactory.newInstance();
    SAXTransformerFactory saxTransFact = null;
    if (tf.getFeature(SAXTransformerFactory.FEATURE)) {
        saxTransFact = (SAXTransformerFactory)tf;
    }
    TransformerHandler transHand = null;
    transHand = saxTransFact.newTransformerHandler();
    DOMResult domResult = new DOMResult();
    transHand.setResult(domResult);
    myBuffer.emit(transHand);
    Element returnResult = ((Document)domResult.getNode())
        .getDocumentElement();

//     org.w3c.dom.Element returnResult
//         = (org.w3c.dom.Element)map.get(name);
View Full Code Here

    String returnResult = (String)map.get(name);
    // check testXSLT.xml for the expected result
    assertTrue(returnResult.equals("Matisse, Henri"));
      }
      if (name.equals("complexResult")) {
    SAXEventBufferImpl myBuffer
        = (SAXEventBufferImpl)map.get(name);
    TransformerFactory tf
        = TransformerFactory.newInstance();
    SAXTransformerFactory saxTransFact = null;
    if (tf.getFeature(SAXTransformerFactory.FEATURE)) {
        saxTransFact = (SAXTransformerFactory)tf;
    }
    TransformerHandler transHand = null;
    transHand = saxTransFact.newTransformerHandler();
    DOMResult domResult = new DOMResult();
    transHand.setResult(domResult);
    myBuffer.emit(transHand);
    Element returnResult = ((Document)domResult.getNode())
        .getDocumentElement();

//      javax.xml.transform.stream.StreamResult streamResult
//         = new javax.xml.transform.stream.StreamResult(System.out);
View Full Code Here

    String returnResult = (String)map.get(name);
    // check testXSLT.xml for the expected result
    assertTrue(returnResult.equals("Matisse, Henri"));
      }
      if (name.equals("complexResult")) {
    SAXEventBufferImpl myBuffer
        = (SAXEventBufferImpl)map.get(name);
    TransformerFactory tf
        = TransformerFactory.newInstance();
    SAXTransformerFactory saxTransFact = null;
    if (tf.getFeature(SAXTransformerFactory.FEATURE)) {
        saxTransFact = (SAXTransformerFactory)tf;
    }
    TransformerHandler transHand = null;
    transHand = saxTransFact.newTransformerHandler();
    DOMResult domResult = new DOMResult();
    transHand.setResult(domResult);
    myBuffer.emit(transHand);
    Element returnResult = ((Document)domResult.getNode())
        .getDocumentElement();
   
//      javax.xml.transform.stream.StreamResult streamResult
//         = new javax.xml.transform.stream.StreamResult(System.out);
View Full Code Here

TOP

Related Classes of de.danet.an.workflow.util.SAXEventBufferImpl

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.