Examples of SAXParser


Examples of javax.xml.parsers.SAXParser

   * Creates a new instance of digester. The created digester is ready for
   * parsing report definition files.
   */
  public static JRXmlDigester createDigester() throws ParserConfigurationException, SAXException
  {
    SAXParser parser = createParser();
    JRXmlDigester digester = new JRXmlDigester(parser);
   
    //normally not required because schemaSource is set, but keeping to be safe
    setComponentsInternalEntityResources(digester);
   

Examples of javax.xml.parsers.SAXParser

  parserFactory.setNamespaceAware(true)
  // Now create a SAXParser object


  try{
      SAXParser parser = parserFactory.newSAXParser(); //May throw exceptions
      BibTeXMLHandler handler = new BibTeXMLHandler();
      // Start the parser. It reads the file and calls methods of the handler.
      parser.parse(stream, handler);
      // When you're done, report the results stored by your handler object
      bibItems = handler.getItems();
     
  }catch (javax.xml.parsers.ParserConfigurationException e1){
      e1.printStackTrace();

Examples of javax.xml.parsers.SAXParser

  {
    try
    {
      final CdaResponseParser contentHandler = new CdaResponseParser();
      final SAXParserFactory factory = SAXParserFactory.newInstance();
      final SAXParser parser = factory.newSAXParser();
      final XMLReader reader = parser.getXMLReader();

      try
      {
        reader.setFeature("http://xml.org/sax/features/xmlns-uris", false);
      }

Examples of javax.xml.parsers.SAXParser

   
    public opensearchdescriptionReader(final String path) {
        this();
        try {
            final SAXParserFactory factory = SAXParserFactory.newInstance();
            final SAXParser saxParser = factory.newSAXParser();
            saxParser.parse(path, this);
        } catch (final Exception e) {
            Log.logException(e);
        }
    }

Examples of javax.xml.parsers.SAXParser

   
    public opensearchdescriptionReader(final InputStream stream) {
        this();
        try {
            final SAXParserFactory factory = SAXParserFactory.newInstance();
            final SAXParser saxParser = factory.newSAXParser();
            saxParser.parse(stream, this);
        } catch (final Exception e) {
            Log.logException(e);
        }
    }

Examples of javax.xml.parsers.SAXParser

   * This method has been added, since configuration for
   * schema validation seems to be broken in digester 1.6.
   * Therefore, we directly set the JAXP properties.
   */
  protected Digester createDigester() {
    SAXParser parser = null;
    try {
      parser = factory.newSAXParser();
    } catch (Exception e) {
      // should not happen...
    }
    if (schemaResolver != null) {
      try {
        parser.setProperty(
          "http://java.sun.com/xml/jaxp/properties/schemaLanguage",
          "http://www.w3.org/2001/XMLSchema"
        );
        parser.setProperty(
          "http://java.sun.com/xml/jaxp/properties/schemaSource",
          getSchemaResolver().getURI()
        );
      } catch (Exception e) {
        log.info("Parser doesn't support XML Schema validation, using DTD...");

Examples of javax.xml.parsers.SAXParser

    try {
      // somewhat akward work-around to avoid making MSV a compile-time dependency
      SAXParserFactory factory = (SAXParserFactory) ClassLoaderUtil.newInstance(
          "com.sun.msv.verifier.jaxp.SAXParserFactoryImpl");
      factory.setNamespaceAware(true);
      SAXParser saxParser = factory.newSAXParser();
      // would be nice to set the property on the XMLReader (instead of the SAXParser), but that wouldn't work
      saxParser.setProperty("http://www.sun.com/xml/msv/schema", source);
      parser = saxParser.getXMLReader();
     
      // find root filter, if any
      XMLReader filter = parser;
      while (filter instanceof XMLFilter && ((XMLFilter) filter).getParent() instanceof XMLFilter) {
        if (DEBUG) System.err.println("currFilter=" + filter);

Examples of javax.xml.parsers.SAXParser

        // Use the default (non-validating) parser
        SAXParserFactory factory = SAXParserFactory.newInstance();
        try {
            // Parse the input
            SAXParser saxParser;
            saxParser = factory.newSAXParser();
            saxParser.parse(inStream, handler);
        } catch (ParserConfigurationException e) {
          if (!GPLogger.log(e)) {
            e.printStackTrace(System.err);
          }
            throw new IOException(e.getMessage());

Examples of javax.xml.parsers.SAXParser

        // Use the default (non-validating) parser
        SAXParserFactory factory = SAXParserFactory.newInstance();
        try {

            // Parse the input
            SAXParser saxParser = factory.newSAXParser();
            saxParser.parse(file, handler);
        } catch (Exception e) {
            myUIFacade.showErrorDialog(e);
            /*
            GanttDialogInfo gdi = new GanttDialogInfo((JFrame) myUIFacade,
                    GanttDialogInfo.ERROR, GanttDialogInfo.YES_OPTION, language

Examples of mf.javax.xml.parsers.SAXParser

    this.catalog = catalog;

    try {
      if (parserFactory != null) {
  SAXParser parser = parserFactory.newSAXParser();
  SAXParserHandler spHandler = new SAXParserHandler();
  spHandler.setContentHandler(this);
  if (bResolver != null) {
    spHandler.setEntityResolver(bResolver);
  }
  parser.parse(new InputSource(is), spHandler);
      } else {
  Parser parser = (Parser) Class.forName(parserClass, true, loader != null ? loader : this.getClass().getClassLoader()).newInstance();
  parser.setDocumentHandler(this);
  if (bResolver != null) {
    parser.setEntityResolver(bResolver);
  }
  parser.parse(new InputSource(is));
      }
    } catch (ClassNotFoundException cnfe) {
      throw new CatalogException(CatalogException.UNPARSEABLE);
    } catch (IllegalAccessException iae) {
      throw new CatalogException(CatalogException.UNPARSEABLE);
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.