Package javax.xml.transform.sax

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


            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


            NAMESPACE,
            COLLECTION_NAME,
            PREFIX + ":" + COLLECTION_NAME,
            new AttributesImpl());
        this.resourcesToSax(resources, th);
        th.endElement(
            NAMESPACE,
            COLLECTION_NAME,
            PREFIX + ":" + COLLECTION_NAME);
        th.endDocument();
        return new ByteArrayInputStream(bOut.toByteArray());
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();
            if (writer.toString().indexOf("xmlns") == -1) {
                // The serializer does not output xmlns declarations,
                // so we need to do it explicitly with this wrapper
View Full Code Here

                        }
                    } else {
                        // atts.addAttribute("", "", "share", "CDATA", SHARE_DEFAULT);
                    }
                    ch.startElement("", "artifact", "artifact", atts);
                    ch.endElement("", "artifact", "artifact");
                    atts.clear();
                }
                ch.endElement("", "classpath", "classpath");
                ch.endElement("", "classloader", "classloader");
                ch.endDocument();
View Full Code Here

                    }
                    ch.startElement("", "artifact", "artifact", atts);
                    ch.endElement("", "artifact", "artifact");
                    atts.clear();
                }
                ch.endElement("", "classpath", "classpath");
                ch.endElement("", "classloader", "classloader");
                ch.endDocument();
                fos.close();
                if(entryMap.size() > 0) {
                    getLog().warn("Classloader template contains entries that could not be resolved.");
View Full Code Here

                    ch.startElement("", "artifact", "artifact", atts);
                    ch.endElement("", "artifact", "artifact");
                    atts.clear();
                }
                ch.endElement("", "classpath", "classpath");
                ch.endElement("", "classloader", "classloader");
                ch.endDocument();
                fos.close();
                if(entryMap.size() > 0) {
                    getLog().warn("Classloader template contains entries that could not be resolved.");
                }
View Full Code Here

            handler.comment(comment, 0, comment.length);
        }
        AttributesImpl attributes = new AttributesImpl();
        handler.startElement(null, "plist", "plist", attributes);
        serializeMap(propertyList, handler);
        handler.endElement(null, "plist", "plist");

        handler.endDocument();
    }

    /**
 
View Full Code Here

        th.setResult(result);
        th.startDocument();
        th.startPrefixMapping(PREFIX, NAMESPACE);
        th.startElement(NAMESPACE, COLLECTION_NAME, PREFIX + ":" + COLLECTION_NAME, XMLUtils.EMPTY_ATTRIBUTES);
        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

            // Output a single element
            handler.startDocument();
            handler.startPrefixMapping(prefix, uri);
            handler.startElement(uri, "element", "element", XMLUtils.EMPTY_ATTRIBUTES);
            handler.endElement(uri, "element", "element");
            handler.endPrefixMapping(prefix);
            handler.endDocument();

            String text = writer.toString();
View Full Code Here

                            for (Iterator iterator = artifactDestPaths.iterator(); iterator
                                    .hasNext();) {
                                String artifactDestPath = (String) iterator.next();
                                writeRetrieveLocation(saxHandler, artifactDestPath);
                            }
                            saxHandler.endElement(null, "artifact", "artifact");
                        }
                    }
                    saxHandler.endElement(null, "module", "module");
                }
                saxHandler.endElement(null, "modules", "modules");
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.