Package org.xml.sax

Examples of org.xml.sax.XMLReader


  synchronized public XMLReader getXMLReader(Source inputSource)
  {

    try
    {
      XMLReader reader = (inputSource instanceof SAXSource)
                         ? ((SAXSource) inputSource).getXMLReader() : null;

      // If user did not supply a reader, ask for one from the reader manager
      if (null == reader) {
        if (m_readerManager == null) {
View Full Code Here


    public Transformer getTransformer() {
        return _transformer;
    }

    private void createParent() throws SAXException {
  XMLReader parent = null;
        try {
            SAXParserFactory pfactory = SAXParserFactory.newInstance();
            pfactory.setNamespaceAware(true);
           
            if (_transformer.isSecureProcessing()) {
View Full Code Here

        setParent(parent);
    }

    public void parse (InputSource input) throws SAXException, IOException
    {
        XMLReader managedReader = null;

        try {
            if (getParent() == null) {
                try {
                    managedReader = XMLReaderManager.getInstance()
View Full Code Here

  private Schema parse(FileRef input) throws IOException, SAXException {
    InputStream inputStream = input.openInputStream();
    InputSource inputSource = new InputSource(inputStream);
    SaxEventHandler eventHandler = new SaxEventHandler(input);
    XMLReader xmlReader;
    xmlReader = XMLReaderFactory.createXMLReader();
    xmlReader.setContentHandler(eventHandler);

    xmlReader.parse(inputSource);
    inputStream.close();
    return eventHandler.getSchema();
  }
View Full Code Here

    this.proxyRetriever = new Cas20ProxyRetriever(casServerUrlPrefix);
  }

  @Override
  protected Assertion parseResponseFromServer(String response) throws TicketValidationException {
    XMLReader r;
    try {
      r = XMLReaderFactory.createXMLReader();
      r.setFeature("http://xml.org/sax/features/namespaces", false);
      ServiceXmlHandler handler = new ServiceXmlHandler();
      r.setContentHandler(handler);
      r.parse(new InputSource(new StringReader(response)));
      return handler.getAssertion(proxyGrantingTicketStorage, proxyRetriever);
    } catch (SAXException e) {
      throw new RuntimeException(e);
    } catch (IOException e) {
      throw new RuntimeException(e);
View Full Code Here

     }

    //*-- parse the content.xml file with the SAXParser
    try
    {
     XMLReader parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
     parser.setContentHandler(new OOHandler());
     parser.parse(outfile);
    }
    catch (OutOfMemoryError oe) { logger.error("Ran out of memory for " + outfile + " or could be corrupt file " + oe.getMessage()); }
    catch (SAXException se) { logger.error("Could not parse XML file" + outfile + " " + se.getMessage()); }
    catch (IOException  ie) { logger.error("Could not read  XML file" + outfile + " " + ie.getMessage()); }
   
View Full Code Here

    InputStream inputStream = input.openInputStream();
    try {
      InputSource inputSource = new InputSource(inputStream);
      SaxEventAdapter saxEventAdapter = new SaxEventAdapter(input, eventHandler);
      try {
        XMLReader xmlReader = new SAXParser();
        xmlReader.setContentHandler(saxEventAdapter);
        xmlReader.setDTDHandler(saxEventAdapter);
        xmlReader.setEntityResolver(saxEventAdapter);
        xmlReader.setErrorHandler(saxEventAdapter);

        // Enable full namespace handling.
        xmlReader.setFeature("http://xml.org/sax/features/namespaces", true);
        xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);

        xmlReader.parse(inputSource);
      } catch (SAXException saxException) {
        if (!saxEventAdapter.getExceptionMessages().contains(saxException.getMessage())) {
          eventHandler.add(new SaxAlert(new SourcePosition(input),
                                        Severity.ERROR, saxException));
        }
View Full Code Here

  {
    try
    {
      try
      {
        final XMLReader parser = XMLReaderFactory.createXMLReader();
        parser.setContentHandler(handler);
   
        parser.parse(new InputSource(is));
      }
      catch (SAXException e)
      {  handler.postError(e);
      } catch (IOException e)
      {
View Full Code Here

    boolean validating = JRProperties.getBooleanProperty(JRProperties.EXPORT_XML_VALIDATION);   
    saxParserFactory.setValidating(validating);

    SAXParser saxParser = saxParserFactory.newSAXParser();
    //XMLReader xmlReader = XMLReaderFactory.createXMLReader();
    XMLReader xmlReader = saxParser.getXMLReader();

    xmlReader.setFeature("http://xml.org/sax/features/validation", validating);

    JRXmlDigester digester = new JRXmlDigester(xmlReader);
    digester.push(this);
    //digester.setDebug(3);
    digester.setErrorHandler(this);
View Full Code Here

      try
      {
         InputSource input = new InputSource(is);
         input.setSystemId(file.toURI().toString());
         XMLReader reader = XMLReaderFactory.createXMLReader();
         reader.setEntityResolver(new JBossEntityResolver());
         SAXSource source = new SAXSource(reader, input);
         JAXBElement<ManagedConnectionFactoryDeploymentGroup> elem = um.unmarshal(source, ManagedConnectionFactoryDeploymentGroup.class);
         ManagedConnectionFactoryDeploymentGroup deployment = elem.getValue();
         repository.addManagedConnectionFactoryDeploymentGroup(deployment);
         return deployment;
View Full Code Here

TOP

Related Classes of org.xml.sax.XMLReader

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.