Create a parser which is suitably configured for parsing an XMPP XML
    stream. It comes equipped with :class:`XMPPLexicalHandler`.
963249
def make_parser():
    
    p = xml.sax.make_parser()
    p.setFeature(xml.sax.handler.feature_namespaces, True)
    p.setFeature(xml.sax.handler.feature_external_ges, False)
    p.setProperty(xml.sax.handler.property_lexical_handler,
                  XMPPLexicalHandler)
    return p
1139339
static public ContentHandleFactory newFactory() {
    return new ContentHandleFactory() {
      @Override
      public Class<?>[] getHandledClasses() {
        return new Class<?>[]{ XMLEventReader.class };
      }
      @Override
      public boolean isHandled(Class<?> type) {
        return XMLEventReader.class.isAssignableFrom(type);
      }
      @Override
      public <C> ContentHandle<C> newHandle(Class<C> type) {
        @SuppressWarnings("unchecked")
        ContentHandle<C> handle = isHandled(type) ?
                                  (ContentHandle<C>) new XMLEventReaderHandle() : null;
        return handle;
      }
    };
  }
1336774
public static OSMFileHeader create(long id, XMLStreamReader parser) throws XMLStreamException {
        OSMFileHeader header = new OSMFileHeader();
        parser.nextTag();
        return header;
    }
303578
protected void parse(InputStream in) throws Exception {
        DefaultHandler handler = new StateConfigHandler();
        SAXParserFactory saxFactory = SAXParserFactory.newInstance();
        saxFactory.setValidating(true);
        SAXParser parser = saxFactory.newSAXParser();
        parser.parse(in, handler);
    }
850775
def _make_parser(streamer, the_struct):
    ""
    struct_items = [s.split(":") for s in the_struct.split()]
    names = [s[0] for s in struct_items]
    types = ''.join(s[1] for s in struct_items)

    def f(message_stream):
        return streamer.parse_as_dict(names, types, message_stream)
    return f
555735
@SuppressWarnings("unchecked")
    protected RequestParser<T> createRequestParser(String configurationKey,String defaultParserClassName)
    {
        if(configurationKey==null)
        {
            throw new FaxException("Configuration key for request parser not provided.");
        }

        //get class name
        String className=this.getConfigurationValue(configurationKey);

        //if no class name configured, use default
        if(className==null)
        {
            className=defaultParserClassName;
            
            if(className==null)
            {
                throw new FaxException("Request parser class name not found.");
            }
        }

        //create new instance
        RequestParser<T> parser=(RequestParser<T>)ReflectionHelper.createInstance(className);
            
        //initialize
        Map<String,String> configuration=this.getConfiguration();
        parser.initialize(configuration);
        
        return parser;
    }
1336676
public ProcessesXmlParse createParse() {
    ProcessesXmlParse processesXmlParse = new ProcessesXmlParse(this);
    processesXmlParse.setSchemaResource(ReflectUtil.getResourceUrlAsString(PROCESS_APPLICATION_XSD));
    return processesXmlParse;
  }
631308
private void installLexicalHandler ()
    {
        XMLReader parent = getParent();
        if (parent == null) {
            throw new NullPointerException("No parent for filter");
        }
        // try to register for lexical events
        for (int i = 0; i < LEXICAL_HANDLER_NAMES.length; i++) {
            try {
                parent.setProperty(LEXICAL_HANDLER_NAMES[i], this);
                break;
            }
            catch (SAXNotRecognizedException ex) {
                // ignore
            }
            catch (SAXNotSupportedException ex) {
                // ignore
            }
        }
    }
1063808
protected ProcessOutputHandler createProcessOutputHandler()
    {
        //get process output handler
        String className=this.getConfigurationValue(FaxClientSpiConfigurationConstants.PROCESS_OUTPUT_HANDLER_PRE_FORMAT_PROPERTY_KEY);
        ProcessOutputHandler handler=null;
        if(className!=null)
        {
            //create new instance
            handler=(ProcessOutputHandler)ReflectionHelper.createInstance(className);
        }

        return handler;
    }
870356
function () {
            if (typeof DOMParser === undefined) {
                try {
                    return Components.classes["@mozilla.org/xmlextras/domparser;1"]
                        .createInstance(Components.interfaces.nsIDOMParser);
                } catch (e) {
                    return;
                }
            } else {
                return new DOMParser();
            }
        }
257178
private static SAXParser createSAXParser()
      throws ParserConfigurationException, SAXException {
    SAXParserFactory factory = SAXParserFactory.newInstance();
    factory.setValidating(false);
    factory.setXIncludeAware(false);
    factory.setFeature(
        "http://xml.org/sax/features/external-general-entities", false);
    factory.setFeature(
        "http://xml.org/sax/features/external-parameter-entities", false);
    factory.setFeature(
        "http://apache.org/xml/features/nonvalidating/load-external-dtd",
        false);
    factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);

    SAXParser parser = factory.newSAXParser();
    XMLReader xmlReader = parser.getXMLReader();
    xmlReader.setEntityResolver(NOOP_RESOLVER);
    return parser;
  }
754209
@Override
    public XMLStreamReader createXMLStreamReader(InputStream in)
        throws XMLStreamException
    {
        // false for auto-close, since caller has access to the input stream
        return createSR(null, in, null, false, false);
    }
731183
def createPushParser(SAX, chunk, size, URI):
    
    ret = libxml2mod.xmlCreatePushParser(SAX, chunk, size, URI)
    if ret is None:raise parserError('xmlCreatePushParser() failed')
    return parserCtxt(_obj=ret)
411728
public Class<? extends org.eclipse.xtext.parser.IParser> bindIParser() {
		return org.eclipse.xtext.generator.parser.antlr.debug.parser.antlr.SimpleAntlrParser.class;
	}
353854
public XmlWrapperParser createParser(InputStream inputStream) {
        try {
			return new XmlWrapperParser(this, inputStream, getSupportedFormat());
		} catch (Exception e) {
			e.printStackTrace();
			throw new KriptonRuntimeException(e);
		}
	}
286757
function xmlparser(options) {

  var parserOptions = util._extend({
      async: false,
      explicitArray: true,
      normalize: true,
      normalizeTags: true,
      trim: true
    }, options || {});

  return xmlbodyparser;
  
  /**
   * Provide connect/express-style middleware
   *
   * @param {IncomingMessage} req
   * @param {ServerResponse} res
   * @param {Function} next
   * @return {*}
   */

  function xmlbodyparser(req, res, next) {

    var data = '';

    var parser = new xml2js.Parser(parserOptions);

    /**
     * @param {Error} err
     * @param {Object} [xml]
     */

    var responseHandler = function (err, xml) {
        if (err) {
          err.status = 400;
          return next(err);
        }

        req.body = xml || req.body;
        req.rawBody = data;
        next();
    };

    if (req._body) {
      return next();
    }

    req.body = req.body || {};

    if (!hasBody(req) || !module.exports.regexp.test(mime(req))) {
      return next();
    }

    req._body = true;

    // explicitly cast incoming to string
    req.setEncoding('utf-8');
    req.on('data', function (chunk) {
      data += chunk;
    });

    // in case `parseString` callback never was called, ensure response is sent
    parser.saxParser.onend = function() {
      if (req.complete && req.rawBody === undefined) {
        return responseHandler(null);
      }
    };

    req.on('end', function () {

      // invalid xml, length required
      if (data.trim().length === 0) {
        return next(error(411));
      }

      parser.parseString(data, responseHandler);

    });
  }

}
753262
public static void parse (DefaultHandler handler, InputStream in)
        throws IOException, ParserConfigurationException, SAXException
    {
        XMLReader xr = _pfactory.newSAXParser().getXMLReader();

        xr.setContentHandler(handler);
        xr.setErrorHandler(handler);

        xr.parse(new InputSource(in));
    }