Package org.jdom.input

Examples of org.jdom.input.DOMBuilder


      throw new InvalidDataException
    ("Invalid type for data field \"" + name
     + "\": " + ((Class)type).getName ());
  }
  // now do changes
  DOMBuilder builder = null;
  ProcessData oldValues = new DefaultProcessData();
  for (Iterator i = (new ArrayList (newValues.keySet())).iterator();
       i.hasNext();) {
      String name = (String)i.next();
      oldValues.put(name, getPaProcessData().get(name));
View Full Code Here


            return null;
        }
    }
   
    private static Element toJdom(final org.w3c.dom.Element e) {
        return  new DOMBuilder().build(e);
      }
View Full Code Here

    metaString = _metaString;
    pageString = _pageString;
   
   
   
    DOMBuilder builder=new DOMBuilder();
    Document doc=builder.build(w3cdoc);

    Element selection = new Element("div")
              .setAttribute("id", "selection");
    List<Element> resources=doc.getRootElement().getChildren("resource",fresnelNS);
   
View Full Code Here

    }

    public XMLValue getPropertyAsXMLValue(URI uri, String namespace, String name, Credentials credentials) throws IOException {
    Property property = getProperty(uri, namespace, name, credentials);
    if ( property == null ) return null;
    DOMBuilder builder = new DOMBuilder();
        Element element = builder.build(property.getElement());
    return new ElementValue(element);
    }
View Full Code Here

        Node node = xml.getWrappedNode();
        Document document = (Document)node; // assume that we're given the
        // entire document.
        // if that's an issue, we could code something more complex.
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        org.jdom.Document jDocument = new DOMBuilder().build(document);
        org.jdom.output.Format format = org.jdom.output.Format.getRawFormat();
        format.setEncoding("utf-8");
        try {
            new XMLOutputter(format).output(jDocument, baos);
        } catch (IOException e) {
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

    try {
      Result result = createOutput("",fileName);
      if(result instanceof StreamResult) {           
        final Writer writer = ((StreamResult)result).getWriter();
       
        DOMBuilder domBuilder = new DOMBuilder("org.apache.xerces.parsers.DOMParser");
        org.jdom.Element jroot = domBuilder.build(element);
        XMLOutputter outputter = new XMLOutputter();
        outputter.output(jroot, writer);
            if(writer != null) writer.close();
            status = true;
      }
View Full Code Here

  }
 
  private void write(org.w3c.dom.Element element, OutputStream outstream){   
    boolean status = false;
    try {
      DOMBuilder domBuilder = new DOMBuilder("org.apache.xerces.parsers.DOMParser");
      org.jdom.Element jroot = domBuilder.build(element);
      XMLOutputter outputter = new XMLOutputter();
      outputter.output(jroot, outstream);
          status = true;
    } catch (Exception e){
      status = false;
View Full Code Here

      int num_records = 0;
      String res_id = "";
      long idle = 0;

      if ( ( result.records != null ) && ( result.records.length > 0 ) ) {
        DOMBuilder builder = new DOMBuilder();


        num_records = result.records.length;
        res_id = result.result_set_id;
        idle = result.result_set_idle_time ;

        for ( int i=0; i<result.records.length;i++ ) {

          Element elem = new Element("record");
          elem.setAttribute( new Attribute("recordPosition",""+first_record+i));

          ExplicitRecordFormatSpecification res = result.records[i].getFormatSpecification();

          // check if the format corresponds to what we are requesting
          if ( ! res.toString().equals(display_spec.toString()) ) {
            Log.error(Geonet.SRU, "error, format specification "+result.records[i].getFormatSpecification()+" does not correspond to "+display_spec+" :"+result.records[i].getOriginalObject() );


            addToDiag(elem, "info:srw/diagnostic/1/67", "Record not available in this schema", result.records[i].getOriginalObject().toString());

            //throw new Exception("SRU error:"+result.records[i].getOriginalObject());                                              
          }

          else if (result.records[i].getOriginalObject() instanceof org.jdom.Document )
          {
            org.jdom.Document doc = (org.jdom.Document)result.records[i].getOriginalObject();

            Element e = doc.getRootElement();
            e.detach();

            elem.addContent(e);
          }

          else if (result.records[i].getOriginalObject() instanceof Document )
          {
            Document d = (Document)result.records[i].getOriginalObject();

            // FIXME: ARHHHHH!!!!! this is inefficient... there must be another way of doing this
            org.jdom.Document doc = builder.build(d);

            Element e = doc.getRootElement();
            e.detach();

            elem.addContent( e ) ;
View Full Code Here

      dbf.setValidating(false);
      dbf.setIgnoringComments(true);
      DocumentBuilder builder;
      builder = dbf.newDocumentBuilder();
      DomDocument = builder.parse(new InputSource(file.getAbsolutePath()));
      JDomDocument = new DOMBuilder().build(DomDocument);
    } catch (Exception e) {
      e.printStackTrace();
      throw new XMLException(e.getMessage());
    }
  }
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.