Examples of XmlDocument


Examples of com.lightcrafts.utils.xml.XmlDocument

        File file = new File(args[0]);
        ImageInfo info = ImageInfo.getInstanceFor(file);
        ImageMetadata meta = info.getMetadata();
        URL url = getDefaultDocumentUrl(meta);
        if (url != null) {
            XmlDocument doc = DocumentDatabase.getDefaultDocument(meta);
            doc.write(System.out);
        }
        System.out.println(url);
    }
View Full Code Here

Examples of com.lightcrafts.utils.xml.XmlDocument

    public static XmlDocument getDefaultDocument(ImageMetadata meta) {
        URL url = DefaultDocuments.getDefaultDocumentUrl(meta);
        if (url != null) {
            try {
                InputStream in = url.openStream();
                XmlDocument doc = new XmlDocument(in);
                in.close();
                return doc;
            }
            catch (IOException e) {
                if (DefaultDocuments.Debug) {
View Full Code Here

Examples of com.lightcrafts.utils.xml.XmlDocument

        File file = new File(dir, "test.tif");
        options.setExportFile(file);

        // Must enqueue the dialog because the file filter listener
        // enqueues some of its actions:
        final XmlDocument doc = new XmlDocument("Root");
        EventQueue.invokeAndWait(
            new Runnable() {
                public void run() {
                    ImageExportOptions o = showDialog(options, null);
                    if (o != null) {
                        o.write(doc.getRoot());
                    }
                    else {
                        System.out.println("cancelled");
                        System.exit(0);
                    }
                }
            }
        );
        doc.write(System.out);
        ImageExportOptions.read(doc.getRoot());
        System.exit(0);
    }
View Full Code Here

Examples of com.lightcrafts.utils.xml.XmlDocument

            if (text != null) {
                try {
                    InputStream in = new ByteArrayInputStream(
                        text.getBytes("UTF-8")
                    );
                    XmlDocument doc = new XmlDocument(in);
                    XmlNode root = doc.getRoot();
                    SaveOptions options = SaveOptions.restore(root);
                    return options;
                }
                catch (Exception e) {   // IOException, XMLException
                    e.printStackTrace();
View Full Code Here

Examples of com.lightcrafts.utils.xml.XmlDocument

        export.resizeHeight.setValue(ExportControls.defaultSaveSize);
        return options;
    }

    public static void setDefaultSaveOptions(SaveOptions options) {
        XmlDocument doc = new XmlDocument("SaveOptions");
        XmlNode root = doc.getRoot();
        options.save(root);
        try {
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            doc.write(out);
            String text = out.toString("UTF-8");
            Prefs.put(SaveOptionsKey, text);
        }
        catch (IOException e) {
            e.printStackTrace();
View Full Code Here

Examples of com.sleepycat.dbxml.XmlDocument

        String docName = null;
        DbXmlManager.writeLock.lock();
        try {

            XmlDocument doc = makeDocument(name, document);
            docName = doc.getName();
            log.debug("Adding document: " + docName);
            m_dbXmlManager.container.putDocument(doc,
                                               m_dbXmlManager.updateContext);
            setLastUpdate(System.currentTimeMillis());
        } catch (XmlException xe) {
View Full Code Here

Examples of com.sun.xml.tree.XmlDocument

      builder.setParser(parser);

      // get the message and parse
      String msgText = ((TextMessage) message).getText();
      parser.parse(new InputSource(new StringReader(msgText)));
      XmlDocument doc =  (XmlDocument) builder.getDocument();
      Element root =  doc.getDocumentElement();

      if (root.getAttribute("message").equalsIgnoreCase("quit")) {
        synchronized(this) {
          quit = true;
          this.notifyAll(); // Notify main thread to quit
        }
      } else {

        System.out.println("\n\nYou have a message in you inbox!");
        System.out.println("From: "+ root.getAttribute("sender"));
        System.out.println("Message: "+ root.getAttribute("message"));
        System.out.println("Status of message: "+ root.getAttribute("status"));

        if (root.getAttribute("status").equals("pending approval")) {
          boolean approved = false;
          boolean denied = false;

          do {
            System.out.print("Approve (\"yes\" or \"no\"): ");

            BufferedReader msgStream = new BufferedReader(new InputStreamReader(System.in));
            String line=null;
            line = msgStream.readLine();
            if (line != null && line.trim().length() != 0) {
              approved = line.equalsIgnoreCase("yes");
              denied = line.equalsIgnoreCase("no");
              if (approved || denied) {
                msg.setStringProperty("messageTo", root.getAttribute("sender"));
   
                // update the original xml doc
                root.setAttribute("status", approved ? "approved" : "approval denied");
                root.setAttribute("sender", "Admin");

                // send xml doc back to JMS queue
                StringWriter sw = new StringWriter();
                doc.write(sw);
                msg.setText(sw.toString());
                System.out.println("Message status updated. Returning message to sender.");
                qsender.send(msg);
              }
            }
View Full Code Here

Examples of commonj.sdo.helper.XMLDocument

                    name = xmlType.getElementName();
                }
            }
        }

        XMLDocument document = helperContext.getXMLHelper().createDocument(source,
                                                                           name.getNamespaceURI(),
                                                                           name.getLocalPart());
        SDODataSource dataSource = new SDODataSource(document, helperContext);
        OMElement element = AxiomHelper.createOMElement(factory, name, dataSource);
        return element;
View Full Code Here

Examples of diva.util.xml.XmlDocument

            String xmlout;

            public void init() throws Exception {
                url = new URL("file:/java/diva/util/test/xml1.xml"); //FIXME
                document = new XmlDocument(url);
                reader = new XmlReader();
                writer = new XmlWriter();
            }

            public void run() throws Exception {
View Full Code Here

Examples of hu.jokeman.xparser.document.nodes.XMLDocument

            // input file feldologz�sa
            XMLProcessor processor = new XMLProcessor (builder);
            processor.process (fis);

            // dokumentumgy�k�r elk�r�se
            XMLDocument doc = builder.getDocument ();

            // white space takar�t�s
            WhiteSpaceNormalizer wsn = new WhiteSpaceNormalizer ();
            doc.accept (wsn);

            // fa-alak� kiirat�s
            System.out.println ("Feldolgozott adatok kiiratva:");
            System.out.println ();
            TreePrinter tp = new TreePrinter (System.out);
            doc.accept (tp);

            // csom�pontok sz�ml�l�sa
            NodeCounter nc = new NodeCounter ();
            doc.accept (nc);
            System.out.print (nc.getResults ());
           
            // syntax highlight
            SyntaxHighlighter shl = new SyntaxHighlighter (fos);
            doc.accept (shl);
            System.out.println ("Az XML alapj�n k�sz�lt szintaxis-szinezett " +
                    "HTML-dokumentum megtal�lhat� a(z) " + args [0] + ".html file-ban.");
           
        } catch (IOException iox) {
            iox.printStackTrace (System.err);
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.