Package javax.xml.transform

Examples of javax.xml.transform.TransformerException


  {

  String fmsg = XSLMessages.createXPATHMessage(msg, args);
  ErrorListener ehandler = this.getErrorListener();

  TransformerException te = new XPathStylesheetDOM3Exception(fmsg, m_sourceLocator);
  if (null != ehandler)
  {
    // TO DO: Need to get stylesheet Locator from here.
    ehandler.fatalError(te);
  }
View Full Code Here


                Transformer tran = super.getTransformer();
                if (tran != null) {
                  ErrorListener errHandler = tran.getErrorListener();
                  // Issue the warning message
                  if (null != errHandler && m_sourceLocator != null)
                    errHandler.warning(new TransformerException(msg, m_sourceLocator));
                  else
                    System.out.println(msg);
                  }
                else
                  System.out.println(msg);
View Full Code Here

                for (int i = 0; i < count; i++) {
                    if (errorMessage.length() > 0)
                        errorMessage.append('\n');
                    errorMessage.append(errors.elementAt(i).toString());
                }
                throw new SAXException(ErrorMsg.JAXP_COMPILE_ERR, new TransformerException(errorMessage.toString()));
            }
        }
        catch (CompilerException e) {
            throw new SAXException(ErrorMsg.JAXP_COMPILE_ERR, e);
        }
View Full Code Here

    try {
      ByteArrayOutputStream bs = new ByteArrayOutputStream();
      toXMP(bibtexEntries, database, bs);
      return bs.toString();
    } catch (IOException e) {
      throw new TransformerException(e);
    }
  }
View Full Code Here

      // Save
      try {
        document.save(file.getAbsolutePath());
      } catch (COSVisitorException e) {
        throw new TransformerException("Could not write XMP-metadata: "
            + e.getLocalizedMessage());
      }

    } finally {
      if (document != null) {
View Full Code Here

      if(url != null){

        return new StreamSource(url.toString());
      }
     
      throw new TransformerException("Unable to resolve href " + href);
    }

    return null;
  }
View Full Code Here

            if (doc == null) { // fallback to default mechanism
              doc = new DefaultDocumentURIResolver(config).resolve(href, baseURI);
            }
            return wrap(doc, null);
          } catch (ParsingException e) {
            throw new TransformerException(e);
          } catch (IOException e) {
            throw new TransformerException(e);
          }
        }
      }
    );
   
View Full Code Here

   *
   * docWrappers == null disables the allocation minimization feature (not recommended).
   */
  private NodeInfo wrap(Node node, HashMap docWrappers) throws TransformerException {
    if (node == null)
      throw new TransformerException("node must not be null");
    if (node instanceof DocType)
      throw new TransformerException("DocType can't be queried by XQuery/XPath");
   
    Node root = node;
    while (root.getParent() != null) {
      root = root.getParent();
    }
View Full Code Here

          if (!files[i].isDirectory()) {
            Document doc;
            try {
              doc = builder.build(files[i]);
            } catch (Exception e) {
              throw new TransformerException(e);
            }
           
            sources.add(wrap(doc, docWrappers));
          }
        }
View Full Code Here

        SAXResult sax = (SAXResult) result;

        transform(node, sax.getHandler(), sax.getLexicalHandler());
      }
      else
        throw new TransformerException(String.valueOf(result));
    } catch (TransformerException e) {
      throw e;
    } catch (Exception e) {
      throw new TransformerExceptionWrapper(e);
    }
View Full Code Here

TOP

Related Classes of javax.xml.transform.TransformerException

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.