Package org.jdom.input

Examples of org.jdom.input.SAXBuilder


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


  String bmt = "file:C:/dev/tds/bufr/resources/source/ukmet/original/BUFR_D_080731.xml";
  static Map<Integer, Sequence> bmTable = new TreeMap<Integer, Sequence>();
  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

  // read robb's table

  public void readTable() throws IOException {
    org.jdom.Document doc;
    try {
      SAXBuilder builder = new SAXBuilder();
      doc = builder.build(robbxml);
      Element root = doc.getRootElement();
      int count = makeTable(root.getChildren("sequence"));
      System.out.println(" robb count= "+count);

    } catch (JDOMException e) {
View Full Code Here

   
    URL url = new URL(ncmlLocation);

    org.jdom.Document doc;
    try {
      SAXBuilder builder = new SAXBuilder(validate);
      if (debugURL) System.out.println(" NetcdfDataset URL = <" + url + ">");
      doc = builder.build(url);
    } catch (JDOMException e) {
      throw new IOException(e.getMessage());
    }
    if (debugXML) System.out.println(" SAXBuilder done");
View Full Code Here

    if (!xml.exists()) return false;

    InputStream is = new BufferedInputStream(new FileInputStream(xmlLocation));
    org.jdom.Document doc;
    try {
      SAXBuilder builder = new SAXBuilder();
      doc = builder.build(is);
    } catch (JDOMException e) {
      throw new IOException(e.getMessage());
    }

    Element rootElem = doc.getRootElement();
View Full Code Here

    long start = System.currentTimeMillis();
    int count = 0;

    org.jdom.Document doc;
    try {
      SAXBuilder builder = new SAXBuilder();
      doc = builder.build(filename);
    } catch (JDOMException e) {
      throw new IOException(e.getMessage());
    }

    Element root = doc.getRootElement();
View Full Code Here

   * @return an InvCatalogImpl object
   */
  public InvCatalogImpl readXML( StringReader catAsStringReader, URI baseUri )
  {
    XMLEntityResolver resolver = new XMLEntityResolver( false );
    SAXBuilder builder = resolver.getSAXBuilder();

    Document inDoc;
    try
    {
      inDoc = builder.build( catAsStringReader );
    }
    catch ( Exception e )
    {
      InvCatalogImpl cat = new InvCatalogImpl( baseUri.toString(), null, null );
      cat.appendErrorMessage( "**Fatal:  InvCatalogFactory.readXML(String catAsString, URI uri) failed:"
View Full Code Here

  private StringBuilder warnMessages = new StringBuilder();
  private StringBuilder errMessages = new StringBuilder();
  private StringBuilder fatalMessages = new StringBuilder();

  public XMLEntityResolver(boolean validate) {
    saxBuilder = hasXerces ? new SAXBuilder( validate) : new SAXBuilder("org.apache.xerces.parsers.SAXParser", validate);
    saxBuilder.setErrorHandler( new MyErrorHandler() );
    if (validate) {
      saxBuilder.setFeature( "http://apache.org/xml/features/validation/schema", true);
      saxBuilder.setProperty("http://apache.org/xml/properties/schema/external-schemaLocation",
        XMLEntityResolver.getExternalSchemas());
View Full Code Here

    if (debug) System.out.println(" read from XML " + xmlLocation);

    InputStream is = new BufferedInputStream(new FileInputStream(xmlLocation));
    org.jdom.Document doc;
    try {
      SAXBuilder builder = new SAXBuilder();
      doc = builder.build(is);
    } catch (JDOMException e) {
      throw new IOException(e.getMessage() + " reading from XML " + xmlLocation);
    }

    Element rootElem = doc.getRootElement();
View Full Code Here

      System.out.println(" contents=\n" + IO.readContents(is2));
    }

    org.jdom.Document doc;
    try {
      SAXBuilder builder = new SAXBuilder(false);
      if (debugURL) System.out.println(" PointConfig URL = <" + resourceLocation + ">");
      doc = builder.build(is);
    } catch (JDOMException e) {
      throw new IOException(e.getMessage());
    }
    if (debugXML) System.out.println(" SAXBuilder done");
View Full Code Here

TOP

Related Classes of org.jdom.input.SAXBuilder

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.