Package javax.xml.transform.sax

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


    hd.setResult(streamResult);


    try {
      hd.startDocument();

      AttributesImpl dictionaryAttributes = new AttributesImpl();

      dictionaryAttributes.addAttribute("", "", ATTRIBUTE_CASE_SENSITIVE,
                "", String.valueOf(casesensitive));
View Full Code Here


        try {
            FileOutputStream fileOuputStream = new FileOutputStream(tofile);
            try {
                TransformerHandler saxHandler = createTransformerHandler(fileOuputStream);

                saxHandler.startDocument();
                saxHandler.startElement(null, "modules", "modules", new AttributesImpl());

                for (int i = 0; i < dependencies.length; i++) {
                    IvyNode dependency = dependencies[i];
                    if (dependency.getModuleRevision() == null
View Full Code Here

            TransformerHandler transformerHandler;
            transformerHandler = ((SAXTransformerFactory)TransformerFactory.newInstance()).newTransformerHandler();
            transformerHandler.getTransformer().setOutputProperties(format);
            transformerHandler.setResult(new StreamResult(writer));
            if (node.getNodeType() != Node.DOCUMENT_NODE) {
                transformerHandler.startDocument();
            }
            DOMStreamer domStreamer = new DOMStreamer(transformerHandler, transformerHandler);
            domStreamer.stream(node);
            if (node.getNodeType() != Node.DOCUMENT_NODE) {
                transformerHandler.endDocument();
View Full Code Here

            handler.getTransformer().setOutputProperties(format);
            handler.setResult(new StreamResult(writer));

            // Output a single element
            handler.startDocument();
            handler.startPrefixMapping(prefix, uri);
            handler.startElement(uri, "element", "", new AttributesImpl());
            handler.endPrefixMapping(prefix);
            handler.endDocument();
View Full Code Here

            }

            @Override
            public void writeStartDocument() throws XmlWriteException {
                try {
                    transformerHandler.startDocument();
                } catch (SAXException e) {
                    throw new XmlWriteException("Failed writing start document to XML", e);
                }
            }
View Full Code Here

            SAXResult result = new SAXResult(new IncludeXMLConsumer((handler)));
            if (handler instanceof LexicalHandler) {
                result.setLexicalHandler((LexicalHandler) handler);
            }
            transformer.setResult(result);
            transformer.startDocument();
            context.invokeNext(layout, service, transformer);

            transformer.endDocument();
        } catch (XSLTProcessorException xpe) {
            throw new SAXException("XSLT Exception.", xpe);
View Full Code Here

            result.setSystemId(systemId);
        }
        th.setResult(result);
       
        if (getContext() == null) {
            th.startDocument();
        }
        ms.marshal(obj, th);
        if (getContext() == null) {
            th.endDocument();
        }
View Full Code Here

      if (newRootTag == null) {
    // simple input tree
    ((SAXEventBuffer)contentParameters.get(0)).emit(th);
      } else {
    // create new start element
    th.startDocument();
    th.startElement
        ("", newRootTag, newRootTag, new AttributesImpl());
    // content
    Iterator it = contentParameters.iterator();
    while (it.hasNext()) {
View Full Code Here

            TransformerHandler th=XSLT.getTransformerHandler(xslURI);
            th.setResult(new SAXResult(ser));
            org.xml.sax.helpers.AttributesImpl atl = new org.xml.sax.helpers.AttributesImpl();
            atl.addAttribute("","name","name", "CDATA", channelName);
            // add other attributes: hasHelp, hasAbout, hasEdit
            th.startDocument();
            th.startElement("","channel","channel", atl);
            ChannelSAXStreamFilter custodian = new ChannelSAXStreamFilter(th);
            int out=cr.outputRendering(custodian);
            if(out==IChannelRenderer.RENDERING_TIMED_OUT) {
                throw new InternalTimeoutException("The channel has timed out");
View Full Code Here

                  // unplug the buffer
                  try {
                      org.xml.sax.helpers.AttributesImpl atl = new org.xml.sax.helpers.AttributesImpl();
                      atl.addAttribute("","name","name", "CDATA", channelName);
                      // add other attributes: hasHelp, hasAbout, hasEdit
                      th.startDocument();
                      th.startElement("","channel","channel", atl);
                      ChannelSAXStreamFilter custodian = new ChannelSAXStreamFilter(th);
                      custodian.setParent(buffer);
                      buffer.stopBuffering(); buffer.outputBuffer();
                      th.endElement("","channel","channel");
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.