Package org.xml.sax

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


                            outDocHandler));
        }
        ContentHandlerFactory inDocHandlerFactory = new SubdocumentHandlerFactory(inDocHandler);

        if (inDocHandler != null && inRepresentation != SINGLE_XML) {
            inDocHandler.startDocument();
            inDocHandler.startElement("",
                    "classes",
                    "classes",
                    new AttributesImpl());
        }
View Full Code Here


    {
      ContentHandler flistener
        = transformer.createResultContentHandler(new StreamResult(ostream), format);
      try
      {
        flistener.startDocument();
      }
      catch(org.xml.sax.SAXException se)
      {
        throw new TransformerException(se);
      }
View Full Code Here

        String svuri = Name.NS_SV_URI;
        String svprefix = Name.NS_SV_PREFIX + ":";

        ContentHandler ch = superuser.getImportContentHandler(testRootNode.getPath(), ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
        ch.startDocument();
        ch.startPrefixMapping(prefix, uri);

        String nN = "node";
        AttributesImpl attrs = new AttributesImpl();
        attrs.addAttribute(svuri, "name", svprefix + "name", "CDATA", nodeName1);
View Full Code Here

        String uri = "http://www.jcp.org/jcr/sv/1.0";
        String prefix = "sv:";

        ContentHandler ch = parent.getSession().getImportContentHandler(parent.getPath(), ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW);
        try {
            ch.startDocument();

            String nN = "node";
            AttributesImpl attrs = new AttributesImpl();
            attrs.addAttribute(uri, "name", prefix + "name", "CDATA", nodeName);
            ch.startElement(uri, nN, prefix + nN, attrs);
View Full Code Here

   *          a Writer to which the XML string will be written
   */
  public void toXML(Writer aWriter) throws SAXException, IOException {
    XMLSerializer sax2xml = new XMLSerializer(aWriter);
    ContentHandler contentHandler = sax2xml.getContentHandler();
    contentHandler.startDocument();
    toXML(sax2xml.getContentHandler(), true);
    contentHandler.endDocument();
  }

  /**
 
View Full Code Here

   *          an OutputStream to which the XML string will be written
   */
  public void toXML(OutputStream aOutputStream) throws SAXException, IOException {
    XMLSerializer sax2xml = new XMLSerializer(aOutputStream);
    ContentHandler contentHandler = sax2xml.getContentHandler();
    contentHandler.startDocument();
    toXML(sax2xml.getContentHandler(), true);
    contentHandler.endDocument();
  }

  /**
 
View Full Code Here

            }
           
            private void parse() throws SAXException {
                ContentHandler handler = getContentHandler();
                // <root xmlns='http://springframework.org'><string>Foo</string></root>
                handler.startDocument();
                handler.startPrefixMapping("", "http://springframework.org");
                handler.startElement("http://springframework.org", "root", "root", new AttributesImpl());
                handler.startElement("http://springframework.org", "string", "string", new AttributesImpl());
                handler.characters("Foo".toCharArray(), 0, 3);
                handler.endElement("http://springframework.org", "string", "string");
View Full Code Here

        final String namespace = detectMetatypeVersion(metaData);

        try {
            final ContentHandler contentHandler = IOUtils.getSerializer(file);

            contentHandler.startDocument();
            contentHandler.startPrefixMapping(PREFIX, namespace);

            final AttributesImpl ai = new AttributesImpl();
            IOUtils.addAttribute(ai, "localization", localization);
View Full Code Here

                + descriptorFile);
        final ContentHandler contentHandler = IOUtils.getSerializer(descriptorFile);
        // detect namespace to use
        final String namespace = module.getOptions().getSpecVersion().getNamespaceUrl();

        contentHandler.startDocument();
        contentHandler.startPrefixMapping(PREFIX, namespace);

        // wrapper element to generate well formed xml
        contentHandler.startElement("", ComponentDescriptorIO.COMPONENTS, ComponentDescriptorIO.COMPONENTS, new AttributesImpl());
        IOUtils.newline(contentHandler);
View Full Code Here

    XMLSerializer xmlSerializer = new XMLSerializer(out, true);
    ContentHandler xmlSerHandler = xmlSerializer.getContentHandler();

    try {
      xmlSerHandler.startDocument();
      xmlSerHandler.startElement("", CONFIG_ELEMENT, CONFIG_ELEMENT, new AttributesImpl());

      for (String corpusFolder : dotCorpus.getCorpusFolderNameList()) {
        AttributesImpl corpusFolderAttributes = new AttributesImpl();
        corpusFolderAttributes.addAttribute("", "",CORPUS_FOLDER_ATTRIBUTE, "", corpusFolder);
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.