Package org.jdom.input

Examples of org.jdom.input.DOMBuilder


  /*
   * @see org.rssowl.core.interpreter.IInterpreterService#interpretW3CDocument(org.w3c.dom.Document,
   * org.rssowl.core.model.persist.IFeed)
   */
  public void interpretW3CDocument(org.w3c.dom.Document w3cDocument, IFeed feed) throws InterpreterException {
    DOMBuilder domBuilder = new DOMBuilder();
    Document jDomDocument = domBuilder.build(w3cDocument);

    interpretJDomDocument(jDomDocument, feed);
  }
View Full Code Here


   * @see
   * org.rssowl.core.interpreter.IInterpreterService#interpretW3CDocument(org
   * .w3c.dom.Document, org.rssowl.core.model.persist.IFeed)
   */
  public void interpretW3CDocument(org.w3c.dom.Document w3cDocument, IFeed feed) throws InterpreterException {
    DOMBuilder domBuilder = new DOMBuilder();
    Document jDomDocument = domBuilder.build(w3cDocument);

    if (jDomDocument != null)
      interpretJDomDocument(jDomDocument, feed);
  }
View Full Code Here

    public void read() {
        try {
            if (file.exists()) {

                InputStream inputStream = new FileInputStream(file);
                Document document = new DOMBuilder().build(new XML4JDOMAdapter().getDocument(inputStream, false));
                Element root = document.getRootElement();
                Element fileConnectionMappings = root.getChild("file-connection-mapings");

                //connectionBundle.jdomRead(root);
            }
View Full Code Here

        return properties;
    }

    public static Document createXMLDocument(InputStream inputStream) {
        try {
            return new DOMBuilder().build(new XML4JDOMAdapter().getDocument(inputStream, false));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
View Full Code Here

     * Note: Mixed content (text and xml together) will not be returned
     * accurately.
     */
    public String getPropertyAsString() {
      StringBuffer text = new StringBuffer();
        DOMBuilder builder = new DOMBuilder();
        XMLOutputter outputter = new XMLOutputter( Format.getPrettyFormat() );
        org.jdom.Element e = builder.build( element );
        List children = e.getChildren();
        if ( children.size() > 0 ) {
          text.append( outputter.outputString( children ) );
        }
        text.append( e.getTextTrim() );
View Full Code Here

         * -------------------------------- Opac abfragen und erhaltenes Dom-Dokument in JDom-Dokument umwandeln --------------------------------
         */
        Node myHitlist = myOpac.retrievePicaNode(myQuery, 1);
        /* Opac-Beautifier aufrufen */
        myHitlist = this.coc.executeBeautifier(myHitlist);
        Document myJdomDoc = new DOMBuilder().build(myHitlist.getOwnerDocument());
        Element myFirstHit = myJdomDoc.getRootElement().getChild("record");

        /* von dem Treffer den Dokumententyp ermitteln */
        this.gattung = getGattung(myFirstHit);

        myLogger.debug("Gattung: " + this.gattung);
        /*
         * -------------------------------- wenn der Treffer ein Volume eines Multivolume-Bandes ist, dann das Sammelwerk überordnen
         * --------------------------------
         */
        // if (isMultivolume()) {
        if (getOpacDocType().isMultiVolume()) {
            /* Sammelband-PPN ermitteln */
            String multiVolumePpn = getPpnFromParent(myFirstHit, "036D", "9");
            if (multiVolumePpn != "") {
                /* Sammelband aus dem Opac holen */

                myQuery = new Query(multiVolumePpn, "12");
                /* wenn ein Treffer des Parents im Opac gefunden wurde */
                if (myOpac.getNumberOfHits(myQuery) == 1) {
                    Node myParentHitlist = myOpac.retrievePicaNode(myQuery, 1);
                    /* Opac-Beautifier aufrufen */
                    myParentHitlist = this.coc.executeBeautifier(myParentHitlist);
                    /* Konvertierung in jdom-Elemente */
                    Document myJdomDocMultivolumeband = new DOMBuilder().build(myParentHitlist.getOwnerDocument());

                    /* Testausgabe */
                    // XMLOutputter outputter = new XMLOutputter();
                    // FileOutputStream output = new
                    // FileOutputStream("D:/fileParent.xml");
                    // outputter.output(myJdomDocMultivolumeband.getRootElement(),
                    // output);
                    /* dem Rootelement den Volume-Treffer hinzufügen */
                    myFirstHit.getParent().removeContent(myFirstHit);
                    myJdomDocMultivolumeband.getRootElement().addContent(myFirstHit);

                    /* Testausgabe */
                    // output = new FileOutputStream("D:/fileFull.xml");
                    // outputter.output(myJdomDocMultivolumeband.getRootElement(),
                    // output);
                    myJdomDoc = myJdomDocMultivolumeband;
                    myFirstHit = myJdomDoc.getRootElement().getChild("record");

                    /* die Jdom-Element wieder zurück zu Dom konvertieren */
                    DOMOutputter doutputter = new DOMOutputter();
                    myHitlist = doutputter.output(myJdomDocMultivolumeband);
                    /*
                     * dabei aber nicht das Document, sondern das erste Kind nehmen
                     */
                    myHitlist = myHitlist.getFirstChild();
                }
            }
        }

        /*
         * -------------------------------- wenn der Treffer ein Contained Work ist, dann übergeordnetes Werk --------------------------------
         */
        // if (isContainedWork()) {
        if (getOpacDocType().isContainedWork()) {
            /* PPN des übergeordneten Werkes ermitteln */
            String ueberGeordnetePpn = getPpnFromParent(myFirstHit, "021A", "9");
            if (ueberGeordnetePpn != "") {
                /* Sammelband aus dem Opac holen */
                myQuery = new Query(ueberGeordnetePpn, "12");
                /* wenn ein Treffer des Parents im Opac gefunden wurde */
                if (myOpac.getNumberOfHits(myQuery) == 1) {
                    Node myParentHitlist = myOpac.retrievePicaNode(myQuery, 1);
                    /* Opac-Beautifier aufrufen */
                    myParentHitlist = this.coc.executeBeautifier(myParentHitlist);
                    /* Konvertierung in jdom-Elemente */
                    Document myJdomDocParent = new DOMBuilder().build(myParentHitlist.getOwnerDocument());
                    Element myFirstHitParent = myJdomDocParent.getRootElement().getChild("record");
                    /* Testausgabe */
                    // XMLOutputter outputter = new XMLOutputter();
                    // FileOutputStream output = new
                    // FileOutputStream("D:/fileParent.xml");
View Full Code Here

    }

    /*
     * --------------------- aus dem Dom-Node ein JDom-Object machen -------------------
     */
    Document doc = new DOMBuilder().build(myHitlist.getOwnerDocument());
 
    /*
     * --------------------- Im JDom-Object alle Felder durchlaufen und die notwendigen Ersetzungen vornehmen -------------------
     */
    /* alle Records durchlaufen */
 
View Full Code Here

   * Print given DomNode to defined File ================================================================
   */
  private void debugMyNode(Node inNode, String fileName) {
    try {
      XMLOutputter outputter = new XMLOutputter();
      Document tempDoc = new DOMBuilder().build(inNode.getOwnerDocument());
      FileOutputStream output = new FileOutputStream(fileName);
      outputter.output(tempDoc.getRootElement(), output);
    } catch (FileNotFoundException e) {
      myLogger.error("debugMyNode(Node, String)", e);
    } catch (IOException e) {
View Full Code Here

                root = builder.build(docStream).getRootElement();
                docStream.close();    
             }
         else
             {
                DOMBuilder builder = new DOMBuilder();
                root = builder.build(element);
             }
            
         String description = root.getChildText("description");

         if (resourceClassName == null)
View Full Code Here

        } catch (SAXException e) {
            LOG.error("Error parsing Aegis file.", e); // can't happen due to
                                                        // above.
            return null;
        }
        return new DOMBuilder().build(doc);
    }
View Full Code Here

TOP

Related Classes of org.jdom.input.DOMBuilder

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.