Package org.xml.sax

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


            i++;
        }

        if (inDocHandler != null && inRepresentation != SINGLE_XML) {
            inDocHandler.endElement("", "classes", "classes");
            inDocHandler.endDocument();
        }

        if (outRepresentation == SINGLE_XML) {
            zos.closeEntry();
        }
View Full Code Here


       of.setOmitXMLDeclaration(true);
       XMLSerializer serializer = new XMLSerializer(writer, of);
       ContentHandler ch = serializer.asContentHandler();
       ch.startDocument();
       xmlStruct.xsToSAX(ch,serializationOptions);
       ch.endDocument();
   }

   static public void xsToXMLStream(XmlStruct xmlStruct, OutputStream os, String encoding)
   throws IOException, SAXException, XmlStructException
   {
View Full Code Here

       of.setPreserveSpace(true);
       XMLSerializer serializer = new XMLSerializer(os, of);
       ContentHandler ch = serializer.asContentHandler();
       ch.startDocument();
       xmlStruct.xsToSAX(ch,serializationOptions);
       ch.endDocument();
   }

   static public boolean xsFromXML(XmlStruct struct, String xml, ErrorBag eb, String ctx)
   throws XmlStructException
   { return xsFromXML(struct, new StringReader(xml), eb, ctx, null); }
View Full Code Here

      ContentHandler contentHandler = xmlSerializer.getContentHandler();
      contentHandler.startDocument();

      toXML(contentHandler, true);

      contentHandler.endDocument();
      writer.close();
      parsedText = writer.toString();

    } catch (SAXException e) {
      // throw new InternalErrorCDE(Messages.getString("MultiPageEditor.22"), e); //$NON-NLS-1$
View Full Code Here

                AnalysisEngineDescription aed = (AnalysisEngineDescription) trueDescriptor;
                aed.toXML(contentHandler, true, true);
            } else {
                trueDescriptor.toXML(contentHandler, true);
            }
            contentHandler.endDocument();
            writer.close();
            parsedText = writer.toString();

        } catch (SAXException e) {
            // throw new InternalErrorCDE(Messages.getString("MultiPageEditor.22"), e); //$NON-NLS-1$
View Full Code Here

            ch.characters(val, 0, val.length);
            ch.endElement(svuri, "value", svprefix + "value");
        ch.endElement(svuri, pN, svprefix + pN);

        ch.endElement(svuri, nN, svprefix + nN);
        ch.endDocument();

        // test if property has been imported with correct namespace
        String assignedPrefix = superuser.getNamespacePrefix(uri);
        assertTrue(superuser.getNamespaceURI(assignedPrefix).equals(uri));
        String path = testRootNode.getPath() + "/" + nodeName1 + "/" + propertyName1;
View Full Code Here

            ch.characters(val, 0, val.length);
            ch.endElement(uri, "value", prefix + "value");
            ch.endElement(uri, pN, prefix + pN);

            ch.endElement(uri, nN, prefix + nN);
            ch.endDocument();

        } catch (SAXException e) {
            throw new RepositoryException(e);
        }
View Full Code Here

            ch.characters(val, 0, val.length);
            ch.endElement(svuri, "value", svprefix + "value");
        ch.endElement(svuri, pN, svprefix + pN);

        ch.endElement(svuri, nN, svprefix + nN);
        ch.endDocument();

        // test if property has been imported with correct namespace
        String assignedPrefix = superuser.getNamespacePrefix(uri);
        assertTrue(superuser.getNamespaceURI(assignedPrefix).equals(uri));
        String path = testRootNode.getPath() + "/" + nodeName1 + "/" + propertyName1;
View Full Code Here

        handler.startElement(null, "c", "c", new AttributesImpl());
        handler.endElement(null, "c", "c");
        handler.characters("xyz".toCharArray(), 0, 3);
        handler.endElement("uri", "a", "p:a");
        handler.endPrefixMapping("p");
        handler.endDocument();

        String xml = writer.toString();
        assertContains(xml, "<p:a");
        assertContains(xml, "xmlns:p");
        assertContains(xml, "=");
View Full Code Here

        handler.endElement(null, "b", "b");
        handler.startElement(null, "c", "c", new AttributesImpl());
        handler.endElement(null, "c", "c");
        handler.characters("xyz".toCharArray(), 0, 3);
        handler.endElement("uri", "a", "p:a");
        handler.endDocument();

        String xml = writer.toString();
        assertContains(xml, "<p:a");
        assertContains(xml, "xmlns:p");
        assertContains(xml, "=");
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.