Package org.apache.xml.resolver.tools

Examples of org.apache.xml.resolver.tools.ResolvingXMLReader


      System.out.println("Usage: StaticTest [ -c catalog ] xmlfile");
      System.exit(1);
    }

    System.out.println("Parsing with default (static) CatalogManager");
    ResolvingXMLReader reader = new ResolvingXMLReader();
    parse(reader);
  }
View Full Code Here


    System.out.println("Creating my CatalogManager (debug messages)");
    CatalogManager myManager = new CatalogManager();
    myManager.setIgnoreMissingProperties(true);
    myManager.setVerbosity(2);
    System.out.println("Parsing with my CatalogManager");
    ResolvingXMLReader reader = new ResolvingXMLReader(myManager);
    parse(reader);
  }
View Full Code Here

    @Test
    public void testParseCatalog() throws Exception{
        URL file = TestData.url(this, "commonSchemas_new.oasis.xml");

        ResolvingXMLReader reader = new ResolvingXMLReader();
        Catalog catalog = reader.getCatalog();
        catalog.getCatalogManager().setVerbosity(9);

        catalog.parseCatalog(file);
       
        final URL baseUri = new URL("http://schemas.opengis.net/gml/");
View Full Code Here

/* 160 */     if (xmlfile == null) {
/* 161 */       System.out.println("Usage: org.apache.xml.resolver.apps.xread [opts] xmlfile");
/* 162 */       System.exit(1);
/*     */     }
/*     */
/* 165 */     ResolvingXMLReader reader = new ResolvingXMLReader();
/*     */     try
/*     */     {
/* 168 */       reader.setFeature("http://xml.org/sax/features/namespaces", nsAware);
/* 169 */       reader.setFeature("http://xml.org/sax/features/validation", validating);
/* 170 */       if (useSchema) {
/* 171 */         reader.setFeature("http://apache.org/xml/features/validation/schema", true);
/*     */       }
/*     */     }
/*     */     catch (SAXException e)
/*     */     {
/*     */     }
/* 177 */     Catalog catalog = reader.getCatalog();
/*     */
/* 179 */     for (int count = 0; count < catalogFiles.size(); count++) {
/* 180 */       String file = (String)catalogFiles.elementAt(count);
/* 181 */       catalog.parseCatalog(file);
/*     */     }
/*     */
/* 184 */     XParseError xpe = new XParseError(showErrors, showWarnings);
/* 185 */     xpe.setMaxMessages(maxErrs);
/* 186 */     reader.setErrorHandler(xpe);
/*     */
/* 188 */     String parseType = validating ? "validating" : "well-formed";
/* 189 */     String nsType = nsAware ? "namespace-aware" : "namespace-ignorant";
/* 190 */     if (maxErrs > 0) {
/* 191 */       System.out.println("Attempting " + parseType + ", " + nsType + " parse");
/*     */     }
/*     */
/* 198 */     Date startTime = new Date();
/*     */     try
/*     */     {
/* 201 */       reader.parse(xmlfile);
/*     */     } catch (SAXException sx) {
/* 203 */       System.out.println("SAX Exception: " + sx);
/*     */     } catch (Exception e) {
/* 205 */       e.printStackTrace();
/*     */     }
View Full Code Here

TOP

Related Classes of org.apache.xml.resolver.tools.ResolvingXMLReader

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.