Package org.apache.xalan.xsltc.compiler.util

Examples of org.apache.xalan.xsltc.compiler.util.ErrorMsg


      }
      else if (_sourceSystemId != null) {
    input = new InputSource(_sourceSystemId);
      }
      else {
    ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR);
    throw new TransformerException(err.toString());
      }

      // Start pushing SAX events
      reader.parse(input);
  }
  else if (source instanceof SAXSource) {
      final SAXSource sax = (SAXSource) source;
      XMLReader reader = sax.getXMLReader();
      final InputSource input = sax.getInputSource();

      // Create a reader if not set by user
      if (reader == null) {
    reader = _tfactory.getXMLReader();
      }

      // Hook up reader and output handler
      try {
    reader.setProperty(LEXICAL_HANDLER_PROPERTY, handler);
      }
      catch (SAXException e) {
    // Falls through
      }
      reader.setContentHandler(new SAX2TO(handler));

      // Start pushing SAX events
      reader.parse(input);
  }
  else if (source instanceof DOMSource) {
      final DOMSource domsrc = (DOMSource) source;
      new DOM2TO(domsrc.getNode(), handler).parse();
  }
  else if (source instanceof XSLTCSource) {
      final DOMImpl dom = ((XSLTCSource) source).getDOM();
      dom.copy(handler);
  }
  else {
      ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR);
      throw new TransformerException(err.toString());
  }
    }
View Full Code Here


     * @throws IllegalArgumentException
     */
    public void setErrorListener(ErrorListener listener)
  throws IllegalArgumentException {
        if (listener == null) {
      ErrorMsg err = new ErrorMsg(ErrorMsg.ERROR_LISTENER_NULL_ERR,
          "Transformer");
            throw new IllegalArgumentException(err.toString());
  }
        _errorListener = listener;
    }
View Full Code Here

     */
    public String getOutputProperty(String name)
  throws IllegalArgumentException
    {
  if (!validOutputProperty(name)) {
      ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_PROP_ERR, name);
      throw new IllegalArgumentException(err.toString());
  }
  return _properties.getProperty(name);
    }
View Full Code Here

    if (validOutputProperty(name)) {
        _properties.setProperty(name, properties.getProperty(name));
    }
    else {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_PROP_ERR, name);
        throw new IllegalArgumentException(err.toString());
    }
      }
  }
  else {
      _properties = _propertiesClone;
View Full Code Here

     */
    public void setOutputProperty(String name, String value)
  throws IllegalArgumentException
    {
  if (!validOutputProperty(name)) {
      ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_PROP_ERR, name);
      throw new IllegalArgumentException(err.toString());
  }
  _properties.setProperty(name, value);
    }
View Full Code Here

    public void error(TransformerException e)
  throws TransformerException
    {
        Throwable wrapped = e.getException();
        if (wrapped != null) {
            System.err.println(new ErrorMsg(ErrorMsg.ERROR_PLUS_WRAPPED_MSG,
                                            e.getMessageAndLocation(),
                                            wrapped.getMessage()));
        } else {
            System.err.println(new ErrorMsg(ErrorMsg.ERROR_MSG,
                                            e.getMessageAndLocation()));
        }
        throw e;
    }
View Full Code Here

    public void fatalError(TransformerException e)
  throws TransformerException
    {
        Throwable wrapped = e.getException();
        if (wrapped != null) {
            System.err.println(new ErrorMsg(ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG,
                                            e.getMessageAndLocation(),
                                            wrapped.getMessage()));
        } else {
            System.err.println(new ErrorMsg(ErrorMsg.FATAL_ERR_MSG,
                                            e.getMessageAndLocation()));
        }
        throw e;
    }
View Full Code Here

    public void warning(TransformerException e)
  throws TransformerException
    {
        Throwable wrapped = e.getException();
        if (wrapped != null) {
            System.err.println(new ErrorMsg(ErrorMsg.WARNING_PLUS_WRAPPED_MSG,
                                            e.getMessageAndLocation(),
                                            wrapped.getMessage()));
        } else {
            System.err.println(new ErrorMsg(ErrorMsg.WARNING_MSG,
                                            e.getMessageAndLocation()));
        }
    }
View Full Code Here

     * Receive notification of the beginning of a document.
     */
    public void startDocument() throws SAXException {
  // Make sure setResult() was called before the first SAX event
  if (_result == null) {
      ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SET_RESULT_ERR);
      throw new SAXException(err.toString());
  }

  if (!_isIdentity) {
      // Set document URI
      _dom.setDocumentURI(_systemId);
View Full Code Here

    public void transform(Source source, Result result)
  throws TransformerException
    {
  if (!_isIdentity) {
      if (_translet == null) {
    ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_TRANSLET_ERR);
    throw new TransformerException(err.toString());
      }
      // Pass output properties to the translet
      transferOutputProperties(_translet);
  }
     
  final TransletOutputHandler toHandler = getOutputHandler(result);
  if (toHandler == null) {
      ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_HANDLER_ERR);
      throw new TransformerException(err.toString());
  }

  if (_uriResolver != null && !_isIdentity) {
      _translet.setDOMCache(this);
  }
View Full Code Here

TOP

Related Classes of org.apache.xalan.xsltc.compiler.util.ErrorMsg

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.