Package javax.xml.transform

Examples of javax.xml.transform.TransformerConfigurationException


                try {
                _errorListener.fatalError(e1);
                return null;
          }
    catch (TransformerException e2) {
                new TransformerConfigurationException(e2);
          }
            }
            throw e1;
      }
    }
View Full Code Here


                               reader = parserFactory.newSAXParser()
                                     .getXMLReader();

                              
                           } catch (ParserConfigurationException pce ) {
                               throw new TransformerConfigurationException
                                 ("ParserConfigurationException" ,pce);
                           }
                       }
                    }
                    reader.setFeature
                        ("http://xml.org/sax/features/namespaces",true);
                    reader.setFeature
                        ("http://xml.org/sax/features/namespace-prefixes",false);

                    xsltc.setXMLReader(reader);
                }catch (SAXNotRecognizedException snre ) {
                  throw new TransformerConfigurationException
                       ("SAXNotRecognizedException ",snre);
                }catch (SAXNotSupportedException snse ) {
                  throw new TransformerConfigurationException
                       ("SAXNotSupportedException ",snse);
                }catch (SAXException se ) {
                  throw new TransformerConfigurationException
                       ("SAXException ",se);
                }

      }
      // handle  DOMSource 
      else if (source instanceof DOMSource) {
    final DOMSource domsrc = (DOMSource)source;
    final Document dom = (Document)domsrc.getNode();
    final DOM2SAX dom2sax = new DOM2SAX(dom);
    xsltc.setXMLReader(dom2sax)

          // Try to get SAX InputSource from DOM Source.
    input = SAXSource.sourceToInputSource(source);
    if (input == null){
        input = new InputSource(domsrc.getSystemId());
    }
      }
      // Try to get InputStream or Reader from StreamSource
      else if (source instanceof StreamSource) {
    final StreamSource stream = (StreamSource)source;
    final InputStream istream = stream.getInputStream();
    final Reader reader = stream.getReader();
                xsltc.setXMLReader(null);     // Clear old XML reader

    // Create InputSource from Reader or InputStream in Source
    if (istream != null) {
        input = new InputSource(istream);
    }
    else if (reader != null) {
        input = new InputSource(reader);
    }
    else {
        input = new InputSource(systemId);
    }
      }
      else {
    ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_SOURCE_ERR);
    throw new TransformerConfigurationException(err.toString());
      }
      input.setSystemId(systemId);
  }
  catch (NullPointerException e) {
       ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR,
          "TransformerFactory.newTemplates()");
      throw new TransformerConfigurationException(err.toString());
  }
  catch (SecurityException e) {
       ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_ACCESS_ERR, systemId);
      throw new TransformerConfigurationException(err.toString());
  }
  return input;
    }
View Full Code Here

      return;
  }
  else
      // unknown feature
            ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name);
            throw new TransformerConfigurationException(err.toString());
        }
    }
View Full Code Here

                try {
                    errorListener.fatalError(e1);
                    return null;
                }
                catch( TransformerException e2) {
                    new TransformerConfigurationException(e2);
                }
            }
            throw e1;
        }
    }
View Full Code Here

        {
          throw ex;
        }
        catch (TransformerException ex)
        {
          throw new TransformerConfigurationException(ex);
        }

        return null;
      }
      else
      {

        // Should remove this later... but right now diagnostics from
        // TransformerConfigurationException are not good.
        // se.printStackTrace();
        throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se);
        //"processFromNode failed", se);
      }
    }
    catch (TransformerConfigurationException tce)
    {
      // Assume it's already been reported to the error listener.
      throw tce;
    }
   /* catch (TransformerException tce)
    {
      // Assume it's already been reported to the error listener.
      throw new TransformerConfigurationException(tce.getMessage(), tce);
    }*/
    catch (Exception e)
    {
      if (m_errorListener != null)
      {
        try
        {
          m_errorListener.fatalError(new TransformerException(e));
        }
        catch (TransformerConfigurationException ex)
        {
          throw ex;
        }
        catch (TransformerException ex)
        {
          throw new TransformerConfigurationException(ex);
        }

        return null;
      }
      else
      {
        // Should remove this later... but right now diagnostics from
        // TransformerConfigurationException are not good.
        // se.printStackTrace();
        throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed",
                                                    //e);
      }
    }
  }
View Full Code Here

      // OK, good.
    }
    catch (org.xml.sax.SAXException se)
    {
      throw new TransformerConfigurationException(
        "getAssociatedStylesheets failed", se);
    }
    catch (IOException ioe)
    {
      throw new TransformerConfigurationException(
        "getAssociatedStylesheets failed", ioe);
    }

    return handler.getAssociatedStylesheet();
  }
View Full Code Here

    }
    // This implementation does not support the setting of a feature other than
    // the secure processing feature.
    else
    {
      throw new TransformerConfigurationException(
          XSLMessages.createMessage(
            XSLTErrorResources.ER_UNSUPPORTED_FEATURE,
            new Object[] {name}));
    }
  }
View Full Code Here

        {
          throw ex1;
        }
        catch( TransformerException ex1 )
        {
          throw new TransformerConfigurationException(ex1);
        }
      }
      throw ex;
    }
  }
View Full Code Here

        {
          throw ex1;
        }
        catch (TransformerException ex1 )
        {
          throw new TransformerConfigurationException(ex1);
        }
      }
     
      throw ex;
    }
View Full Code Here

        {
          throw ex1;
        }
        catch( TransformerException ex1 )
        {
          throw new TransformerConfigurationException( ex1 );
        }
      }
      throw ex;
    }
  }
View Full Code Here

TOP

Related Classes of javax.xml.transform.TransformerConfigurationException

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.