Package org.apache.xerces.dom

Examples of org.apache.xerces.dom.DocumentImpl


       
        // retrieve the node from the display
        gistoolkit.common.Node tempRootNode = inDisplay.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


       
        // 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

       
        // 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

            // 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

        // 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

            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

        // 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

     * DOCUMENT ME!
     *
     * @return DOCUMENT ME!
     */
    public Document getDocument() {
        return new DocumentImpl();
    }
View Full Code Here

      final URL url = getConf().getResource(configName);
      if (url == null) {
        throw new IOException("Resource not found: " + configName);
      }
      final FileOutputStream fos = new FileOutputStream(new File(url.getFile()));
      final DocumentImpl doc = new DocumentImpl();
      final Element keymatches = doc.createElement(TAG_KEYMATCHES);
      final Iterator iterator = matches.values().iterator();

      while (iterator.hasNext()) {
        final Element keymatch = doc.createElement(TAG_KEYMATCH);
        final KeyMatch keyMatch = (KeyMatch) iterator.next();
        keyMatch.populateElement(keymatch);
        keymatches.appendChild(keymatch);
      }
View Full Code Here

   */
  public void save() throws IOException {
    try {
      final FileOutputStream fos = new FileOutputStream(new File(configfile
          .getFile()));
      final Document doc = new DocumentImpl();
      final Element collections = doc
          .createElement(Subcollection.TAG_COLLECTIONS);
      final Iterator iterator = collectionMap.values().iterator();

      while (iterator.hasNext()) {
        final Subcollection subCol = (Subcollection) iterator.next();
        final Element collection = doc
            .createElement(Subcollection.TAG_COLLECTION);
        collections.appendChild(collection);
        final Element name = doc.createElement(Subcollection.TAG_NAME);
        name.setNodeValue(subCol.getName());
        collection.appendChild(name);
        final Element whiteList = doc
            .createElement(Subcollection.TAG_WHITELIST);
        whiteList.setNodeValue(subCol.getWhiteListString());
        collection.appendChild(whiteList);
        final Element blackList = doc
            .createElement(Subcollection.TAG_BLACKLIST);
        blackList.setNodeValue(subCol.getBlackListString());
        collection.appendChild(blackList);
      }

View Full Code Here

TOP

Related Classes of org.apache.xerces.dom.DocumentImpl

Copyright © 2018 www.massapicom. 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.