Examples of DocumentImpl


Examples of org.apache.xerces.dom.DocumentImpl

       
        // retrieve the node from the display
        gistoolkit.common.Node tempRootNode = inServer.getNode();
       
        // Convert the Node elements to an XML DOM representation
        Document tempDocument = new DocumentImpl();
        Element tempRootElement = tempDocument.createElement("GISToolkit");     // Create Root Element
        addNode(tempDocument, tempRootElement, tempRootNode);
        tempDocument.appendChild(tempRootElement);
       
        // write the XML Document
        File tempFile = new File(inFileName);
        OutputFormat    format  = new OutputFormat( tempDocument );   //Serialize DOM
        format.setIndenting(true);
        format.setLineSeparator("\n");
        FileWriter  fout = new FileWriter(tempFile);        //Writer will be a String
        XMLSerializer    serial = new XMLSerializer( fout, format );
        serial.asDOMSerializer();                            // As a DOM Serializer
        serial.serialize( tempDocument.getDocumentElement() );
        fout.close();
    }
View Full Code Here

Examples of org.apache.xerces.dom.DocumentImpl

       
        // retrieve the node
        gistoolkit.common.Node tempRootNode = inNode;
       
        // Convert the Node elements to an XML DOM representation
        Document tempDocument = new DocumentImpl();
        Element tempRootElement = tempDocument.createElement("GISToolkit");     // Create Root Element
        addNode(tempDocument, tempRootElement, tempRootNode);
        tempDocument.appendChild(tempRootElement);
       
        // write the XML Document
        File tempFile = new File(inFileName);
        OutputFormat    format  = new OutputFormat( tempDocument );   //Serialize DOM
        format.setIndenting(true);
        format.setLineSeparator("\n");
        FileWriter  fout = new FileWriter(tempFile);        //Writer will be a String
        XMLSerializer    serial = new XMLSerializer( fout, format );
        serial.asDOMSerializer();                            // As a DOM Serializer
        serial.serialize( tempDocument.getDocumentElement() );
        fout.close();
    }
View Full Code Here

Examples of org.apache.xerces.dom.DocumentImpl

            // full expansion
            else {
                Class docClass = Class.forName(documentClassName);
                Class defaultDocClass = Class.forName(DEFAULT_DOCUMENT_CLASS_NAME);
                if (isDocumentImpl) {
                    fDocument = new DocumentImpl(fGrammarAccess);
                }
                else {
                    try {
                        Class documentClass = Class.forName(documentClassName);
                        fDocument = (Document)documentClass.newInstance();
View Full Code Here

Examples of org.apache.xerces.dom.DocumentImpl

        // log("password : " + dbPassword);
        log("schema : " + dbSchema);

        DocumentTypeImpl docType = new DocumentTypeImpl(null, "database", null,
                DTDResolver.WEB_SITE_DTD);
        doc = new DocumentImpl(docType);
        doc.appendChild(doc.createComment(
                " Autogenerated by JDBCToXMLSchema! "));

        try
        {
View Full Code Here

Examples of org.apache.xerces.dom.DocumentImpl

            OutputFormat of;
            XMLSerializer serializer;
            Element XMLelement = null;
            Node XMLnode = null;
            // Document (Xerces implementation only).
            Document xmldoc = new DocumentImpl();
            // Root element.
            Element mainElement = xmldoc.createElement("mainElement");
            Element rootFilesForDeleting = xmldoc.createElement("filesForDeleting");
            Element rootDirsForDeleting = xmldoc.createElement("foldersForDeleting");
            Element mainDir = xmldoc.createElement("mainDir");
            SomeFunctionsForInstaller SomeFunctionsForInstaller = new SomeFunctionsForInstaller();
            Map<Integer, String> tmpfileNamesForShortcuts = new HashMap();
            ArrayList<Map> fileNamesForShortcuts = new ArrayList<Map>();
            SomeFunctionsForInstaller SomeFunctionsForInstallerLocal=new SomeFunctionsForInstaller();

            if (zipfile_test.getEncoding() == null) {
                zipfile = new ZipFile(filename, consoleEnc);
            } else {
                zipfile = new ZipFile(filename, zipfile_test.getEncoding());
            }
            zipfile_test.close();

            e = zipfile.getEntries();
            while (e.hasMoreElements()) {
                countFiles++;
                entry = (ZipEntry) e.nextElement();
                localFileName = entry.getName();
                if (localFileName.endsWith("/")) {
                    localFileName = MainFrame.destinationFolder + localFileName;
                    XMLelement = xmldoc.createElementNS(null, "folderForDeleting");
                    XMLelement.setAttributeNS(null, "pathToDir", localFileName);
                    XMLnode = xmldoc.createTextNode(localFileName);
                    XMLelement.appendChild(XMLnode);
                    rootDirsForDeleting.appendChild(XMLelement);

                    nameForDirCreating = new File(MainFrame.destinationFolder + entry.getName());
                    nameForDirCreating.mkdirs();
                }
            }

            e = zipfile.getEntries();
            while (e.hasMoreElements()) {
                countProcessedFiles++;
                countProgress = (int) (countProcessedFiles / countFiles * 100);
                SwingUtilities.invokeLater(new UpdateProgressBarTask(
                        MainFrame.jPB1, countProgress));

                MainFrame.jPB1.repaint();
                count = 0;
                data = new byte[BUFFER];
                entry = (ZipEntry) e.nextElement();

                localFileName = MainFrame.destinationFolder + entry.getName();
                if (!localFileName.endsWith("/")) {
                    XMLelement = xmldoc.createElementNS(null, "fileForDeleting");
                    XMLelement.setAttributeNS(null, "pathToFile", localFileName);
                    XMLnode = xmldoc.createTextNode(localFileName);
                    XMLelement.appendChild(XMLnode);
                    rootFilesForDeleting.appendChild(XMLelement);

                    //System.out.println("Extracting " + localFileName);

                    entryStream = zipfile.getInputStream(entry);

                    is = new BufferedInputStream(entryStream);
                    fos = new FileOutputStream(localFileName);
                    dest = new BufferedOutputStream(fos, BUFFER);

                    while ((count = is.read(data, 0, BUFFER)) != -1) {
                        dest.write(data, 0, count);
                    }

                    dest.flush();
                    dest.close();
                    is.close();
                    entryStream.close();
                }
            }
            zipfile.close();

            XMLelement = xmldoc.createElementNS(null, "mainDirForDeleting");
            XMLelement.setAttributeNS(null, "pathToDir", MainFrame.destinationFolder);
            XMLnode = xmldoc.createTextNode(MainFrame.destinationFolder);
            XMLelement.appendChild(XMLnode);
            mainDir.appendChild(XMLelement);

            mainElement.appendChild(rootFilesForDeleting);
            mainElement.appendChild(rootDirsForDeleting);
            mainElement.appendChild(mainDir);
            xmldoc.appendChild(mainElement);

            fosForXML = new FileOutputStream(MainFrame.destinationFolder + "fileList.xml");
            of = new OutputFormat("XML", "UTF-8", true);
            of.setIndent(1);
            of.setIndenting(true);
            serializer = new XMLSerializer(fosForXML, of);
            serializer.asDOMSerializer();
            serializer.serialize(xmldoc.getDocumentElement());
            fosForXML.close();

            SwingUtilities.invokeLater(new Runnable() {

                @Override
View Full Code Here

Examples of org.apache.xerces.dom.DocumentImpl

        // log("password : " + dbPassword);
        log("schema : " + dbSchema);

        DocumentTypeImpl docType = new DocumentTypeImpl(null, "database", null,
                DTDResolver.WEB_SITE_DTD);
        doc = new DocumentImpl(docType);
        doc.appendChild(doc.createComment(
                " Autogenerated by JDBCToXMLSchema! "));

        try
        {
View Full Code Here

Examples of org.apache.xindice.xml.dom.DocumentImpl

    * @param buffer The Hashtable
    * @return The Document
    */
   public Document convertToDocument(Hashtable buffer) {
      SymbolTable s = getSymbols(buffer);
      return new DocumentImpl((byte []) buffer.get("document"), s, null);
   }
View Full Code Here

Examples of org.apache.xindice.xml.dom.DocumentImpl

    */
   public SymbolTable getSymbols(Hashtable buffer) {
      //if ( ((Long) buffer.get("timestamp")).longValue() != lastMod ) {
        // lastMod = ((Long) buffer.get("timestamp")).longValue();

         Document doc = new DocumentImpl((byte []) buffer.get("symbols"), hcSyms, null);

         if ( syms == null ) {
            syms = new SymbolTable();
         }

         synchronized(syms) {
            syms.streamFromXML(doc.getDocumentElement());
         }
     // }
      return syms;
   }
View Full Code Here

Examples of org.apache.xindice.xml.dom.DocumentImpl

   }

   public SAXEventGenerator(Document doc) {
      try {
         if ( doc instanceof CompressedDocument ) {
            doc = new DocumentImpl(doc);
            CompressedDocument cDoc = (CompressedDocument)doc;
            symbols = cDoc.getSymbols();
            data = cDoc.getDataBytes();
            pos = cDoc.getDataPos();
            len = cDoc.getDataLen();
View Full Code Here

Examples of org.apache.xindice.xml.dom.DocumentImpl

    public org.xmldb.api.base.Collection createCollection(String name)
            throws XMLDBException {

        checkOpen();
        try {
           Document doc = new DocumentImpl();

           Element colEle = doc.createElement("collection");
           colEle.setAttribute("compressed", "true");
           colEle.setAttribute("name", name);
           doc.appendChild(colEle);

           Element filEle = doc.createElement("filer");
           filEle.setAttribute("class", "org.apache.xindice.core.filer.BTreeFiler");
           colEle.appendChild(filEle);          

           return createCollection(name, doc);
        } catch (Exception e) {           
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.