Package javax.xml.transform.sax

Examples of javax.xml.transform.sax.TransformerHandler.endDocument()


                        PREFIX + ":" + COLLECTION_NAME, new AttributesImpl());
        this.resourcesToSax(resources, th);
        th.endElement(NAMESPACE, COLLECTION_NAME,
                      PREFIX + ":" + COLLECTION_NAME);
        th.endPrefixMapping(PREFIX);
        th.endDocument();
        return new ByteArrayInputStream(bOut.toByteArray());
    }

    private void resourcesToSax(
        WebdavResource[] resources,
View Full Code Here


                transformerHandler.startDocument();
            }
            DOMStreamer domStreamer = new DOMStreamer(transformerHandler, transformerHandler);
            domStreamer.stream(node);
            if (node.getNodeType() != Node.DOCUMENT_NODE) {
                transformerHandler.endDocument();
            }
            return writer.toString();
        } catch (javax.xml.transform.TransformerException local) {
            throw new ProcessingException("TransformerException: " + local, local);
        } catch (SAXException local) {
View Full Code Here

                }
            }

            // report footer
            handler.endElement("", "", ReportXMLConst.ELEMENT_REPORT);
            handler.endDocument();

            if (!ReportExecStatus.FAILURE.name().equals(execution.getStatus())) {
                execution.setStatus(ReportExecStatus.SUCCESS);
            }
        } catch (Exception e) {
View Full Code Here

            int out=cr.outputRendering(custodian);
            if(out==IChannelRenderer.RENDERING_TIMED_OUT) {
                throw new InternalTimeoutException("The channel has timed out");
            }
            th.endElement("","channel","channel");
            th.endDocument();
        } catch (InternalPortalException ipe) {
            throw ipe.getCause();
        }
    }
View Full Code Here

                      th.startElement("","channel","channel", atl);
                      ChannelSAXStreamFilter custodian = new ChannelSAXStreamFilter(th);
                      custodian.setParent(buffer);
                      buffer.stopBuffering(); buffer.outputBuffer();
                      th.endElement("","channel","channel");
                      th.endDocument();
                  } catch (SAXException e) {
                      // worst case scenario: partial content output :(
                      LOG.error("error during unbuffering",e);
                  }
              } else {
View Full Code Here

                }
            }

            // report footer
            handler.endElement("", "", ELEMENT_REPORT);
            handler.endDocument();

            if (!ReportExecStatus.FAILURE.name().equals(execution.getStatus())) {
                execution.setStatus(ReportExecStatus.SUCCESS);
            }
        } catch (Exception e) {
View Full Code Here

                handler.characters(new char[] {'\n'}, 0, 1);
                handler.processingInstruction("xpacket", "end=\"w\"");
            }

        }
        handler.endDocument();
    }
   
}
View Full Code Here

        if (getContext() == null) {
            th.startDocument();
        }
        ms.marshal(obj, th);
        if (getContext() == null) {
            th.endDocument();
        }
    }
   
    public void setOutTemplate(String loc) {
        outTemplates = createTemplates(loc);
View Full Code Here

            probe.startDocument();
            probe.startPrefixMapping("p", "uri");
            probe.startElement("uri", "e", "p:e", new AttributesImpl());
            probe.endElement("uri", "e", "p:e");
            probe.endPrefixMapping("p");
            probe.endDocument();
            return writer.toString().indexOf("xmlns") == -1;
        } catch (Exception e) {
            throw new UnsupportedOperationException("XML serialization fails");
        }
    }
View Full Code Here

                    th.endElement(ATOMNS, ENTRY, ENTRY);
                }

                th.endElement(ATOMNS, FEED, FEED);

                th.endDocument();

                os.flush();
            }
        } catch (Exception ex) {
            throw new IOException("error generating feed: " + ex.getMessage());
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.