Package javax.xml.transform.sax

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


        th.startDocument();
        th.startPrefixMapping(PREFIX, NAMESPACE);
        th.startElement(NAMESPACE, COLLECTION_NAME,
                        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());
    }
View Full Code Here


        th.startDocument();
        th.startPrefixMapping(PREFIX, NAMESPACE);
        th.startElement(NAMESPACE, COLLECTION_NAME,
                        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());
    }
View Full Code Here

                    }
                }
            }

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

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

            ChannelSAXStreamFilter custodian = new ChannelSAXStreamFilter(th);
            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.startDocument();
                      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);
                  }
View Full Code Here

                    }
                }
            }

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

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

            TransformerHandler probe = FACTORY.newTransformerHandler();
            probe.setResult(new StreamResult(writer));
            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

                writeAtomElement(th, TITLE, "EventJournal for " + getLocator().getWorkspaceName());

                th.startElement(ATOMNS, AUTHOR, AUTHOR, NOATTRS);
                writeAtomElement(th, NAME, "Jackrabbit Event Journal Feed Generator");
                th.endElement(ATOMNS, AUTHOR, AUTHOR);

                String id = getFullUri(request);
                writeAtomElement(th, ID, id);

                AttributesImpl linkattrs = new AttributesImpl();
View Full Code Here

                    String author = firstEvent.getUserID() == null || firstEvent.getUserID().length() == 0 ? null
                            : firstEvent.getUserID();
                    if (author != null) {
                        th.startElement(ATOMNS, AUTHOR, AUTHOR, NOATTRS);
                        writeAtomElement(th, NAME, author);
                        th.endElement(ATOMNS, AUTHOR, AUTHOR);
                    }

                    writeAtomElement(th, UPDATED, entryupd);

                    th.startElement(ATOMNS, CONTENT, CONTENT, contentatt);
View Full Code Here

                                    .createResourceLocator(locator.getPrefix(), locator.getWorkspacePath(),
                                            e.getPath(), false).getHref(isCollection);
                            th.startElement(DavConstants.NAMESPACE.getURI(), DavConstants.XML_HREF,
                                    DavConstants.XML_HREF, NOATTRS);
                            th.characters(href.toCharArray(), 0, href.length());
                            th.endElement(DavConstants.NAMESPACE.getURI(), DavConstants.XML_HREF, DavConstants.XML_HREF);
                        }

                        // event type
                        String evname = EventUtil.getEventName(e.getType());
                        th.startElement(EVNS, E_EVENTTYPE, E_EVENTTYPE, NOATTRS);
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.