Package org.jdom.input

Examples of org.jdom.input.SAXBuilder.build()


        builder.setEntityResolver(new IgnoreDTDResolver());
      }
      else {
        logger.debug("Using the default EntityResolver.");
      }
      doc = builder.build(docAsReader);
      logger.debug("XmlDocumentReader: document successfully read!");
      if (validate) {
        XmlValidator xmlValidator = new XmlValidator();
        if (xmlValidator.isValid(doc) == false) {
          throw new XmlDocumentReaderException("Document is not valid!");
View Full Code Here


     */
    private static Document readExpectedOutput(String filename) throws IOException, JDOMException {
        final SAXBuilder builder = new SAXBuilder();
        final InputStream input = new FileInputStream(filename);
       
        return builder.build(input);
    }
   
    /**
     * Helper method to format a <code>Document</code> to String.
     *
 
View Full Code Here

  static private List<GribCodeTable> readGribCodes(InputStream ios) throws IOException {
    org.jdom.Document doc;
    try {
      SAXBuilder builder = new SAXBuilder();
      doc = builder.build(ios);
    } catch (JDOMException e) {
      throw new IOException(e.getMessage());
    }
    Element root = doc.getRootElement();
View Full Code Here

  static public List<GribTemplate> readXml(InputStream ios) throws IOException {
    org.jdom.Document doc;
    try {
      SAXBuilder builder = new SAXBuilder();
      doc = builder.build(ios);
    } catch (JDOMException e) {
      throw new IOException(e.getMessage());
    }

    Map<String, GribTemplate> map = new HashMap<String, GribTemplate>();
View Full Code Here

   */
  static public Element readRootElement(String location) throws IOException {
    org.jdom.Document doc;
    try {
      SAXBuilder builder = new SAXBuilder();
      doc = builder.build(location);
    } catch (JDOMException e) {
      throw new IOException(e.getMessage());
    }

    return doc.getRootElement();
View Full Code Here

  public void readBmt() throws IOException {
    org.jdom.Document doc;
    try {
      SAXBuilder builder = new SAXBuilder();
      doc = builder.build(bmt);
      Element root = doc.getRootElement();
      int count = makeBmtTable(root.getChildren("featureCatalogue"));
      System.out.println(" bmt count= " + count);

      /* Format pretty = Format.getPrettyFormat();
View Full Code Here

  static public void prettyPrint() throws IOException {
    org.jdom.Document doc;
    try {
      SAXBuilder builder = new SAXBuilder();
      doc = builder.build("C:/docs/bufr/wmo/Code-FlagTables-11-2007.xml");

      Format pretty = Format.getPrettyFormat();
      String sep = pretty.getLineSeparator();
      String ind = pretty.getIndent();
      String mine = "\r\n";
View Full Code Here

  // next time, probably beter to start with the NCEP HTML pages
  static public void passOne() throws IOException {
    org.jdom.Document orgDoc;
    try {
      SAXBuilder builder = new SAXBuilder();
      orgDoc = builder.build(orgXml);

      org.jdom.Document tdoc = new org.jdom.Document();
      Element root = new Element("tdoc");
      tdoc.setRootElement(root);
      transform(orgDoc.getRootElement(), root);
View Full Code Here

  // pass 2 - transform the hand-edited XML to its final form
  static public void passTwo() throws IOException {
    org.jdom.Document tdoc;
    try {
      SAXBuilder builder = new SAXBuilder();
      tdoc = builder.build(trans1);

      org.jdom.Document ndoc = new org.jdom.Document();
      Element nroot = new Element("ndoc");
      ndoc.setRootElement(nroot);
View Full Code Here

  // pass 3 - look for problems
  static public void passThree() throws IOException {
    org.jdom.Document tdoc;
    try {
      SAXBuilder builder = new SAXBuilder();
      tdoc = builder.build(trans2);

      /* org.jdom.Document ndoc = new org.jdom.Document();
      Element nroot = new Element("ndoc");
      ndoc.setRootElement(nroot);  */

 
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.