Package org.xml.sax

Examples of org.xml.sax.ContentHandler.startDocument()


        assertEquals(
                "<?xml version=\"1.0\"?><test foo=\"A\" bar=\"B\"/>",
                handler.toString());

        handler = new ToXmlContentHandler();
        handler.startDocument();
        attributes = new AttributesImpl();
        attributes.addAttribute("", "bar", "bar", "CDATA", "B");
        attributes.addAttribute("", "foo", "foo", "CDATA", "A");
        handler.startElement("", "test", "test", attributes);
        handler.endElement("", "test", "test");
View Full Code Here


                handler.toString());
    }

    public void testChildElements() throws SAXException {
        ContentHandler handler = new ToXmlContentHandler();
        handler.startDocument();
        handler.startElement("", "test", "test", new AttributesImpl());
        handler.startElement("", "foo", "foo", new AttributesImpl());
        handler.endElement("", "foo", "foo");
        handler.startElement("", "bar", "bar", new AttributesImpl());
        handler.endElement("", "bar", "bar");
View Full Code Here

                handler.toString());
    }

    public void testCharacters() throws SAXException {
        ContentHandler handler = new ToXmlContentHandler();
        handler.startDocument();
        handler.startElement("", "test", "test", new AttributesImpl());
        handler.characters("foo".toCharArray(), 0, 3);
        handler.endElement("", "test", "test");
        handler.endDocument();
        assertEquals(
View Full Code Here

                handler.toString());
    }

    public void testIgnorableWhitespace() throws SAXException {
        ContentHandler handler = new ToXmlContentHandler();
        handler.startDocument();
        handler.ignorableWhitespace("\n".toCharArray(), 0, 1);
        handler.startElement("", "test", "test", new AttributesImpl());
        handler.ignorableWhitespace("\n".toCharArray(), 0, 1);
        handler.endElement("", "test", "test");
        handler.ignorableWhitespace("\n".toCharArray(), 0, 1);
View Full Code Here

                handler.toString());
    }

    public void testProcessingInstruction() throws SAXException {
        ContentHandler handler = new ToXmlContentHandler();
        handler.startDocument();
        handler.processingInstruction("foo", "abc=\"xyz\"");
        handler.startElement("", "test", "test", new AttributesImpl());
        handler.processingInstruction("bar", null);
        handler.endElement("", "test", "test");
        handler.endDocument();
View Full Code Here

                handler.toString());
    }

    public void testComplexDocument() throws SAXException {
        ContentHandler handler = new ToXmlContentHandler();
        handler.startDocument();
        handler.ignorableWhitespace("\n".toCharArray(), 0, 1);
        handler.processingInstruction("foo", "abc=\"xyz\"");
        handler.ignorableWhitespace("\n".toCharArray(), 0, 1);
        AttributesImpl attributes = new AttributesImpl();
        attributes.addAttribute("", "version", "version", "CDATA", "1.0");
View Full Code Here

                        && foNode instanceof ObjectBuiltListener) {
                    ((ObjectSource) subHandler).setObjectBuiltListener(
                            (ObjectBuiltListener) foNode);
                }
               
                subHandler.startDocument();
                subHandler.startElement(namespaceURI, localName,
                        rawName, attlist);
                depth = 1;
                delegate = subHandler;
            }
View Full Code Here

            ByteArrayOutputStream baos = new ByteArrayOutputStream();

            ContentHandler contentHandler = adapter.getContentHandler(context.getBroker(), configFile, parameters, mimeType, baos);

            // process the XSL-FO
            contentHandler.startDocument();
            inputNode.toSAX(context.getBroker(), contentHandler, new Properties());
            contentHandler.endDocument();

            // return the result
            return BinaryValueFromInputStream.getInstance(context, new Base64BinaryValueType(), new ByteArrayInputStream(baos.toByteArray()));
View Full Code Here

            serializer.setOutput(writer, null);
            item.toSAX(context.getBroker(), serializer, SERIALIZATION_PROPERTIES);
            resource.setContent(writer.toString());
          } else {
            final ContentHandler handler = ((XMLResource)resource).setContentAsSAX();
            handler.startDocument();

            item.toSAX(context.getBroker(), handler, SERIALIZATION_PROPERTIES);
            handler.endDocument();
          }
        } else {
View Full Code Here

                        && foNode instanceof ObjectBuiltListener) {
                    ((ObjectSource) subHandler).setObjectBuiltListener(
                            (ObjectBuiltListener) foNode);
                }

                subHandler.startDocument();
                subHandler.startElement(namespaceURI, localName,
                        rawName, attlist);
                depth = 1;
                delegate = subHandler;
            }
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.