Package com.xmlcalabash.core

Examples of com.xmlcalabash.core.XProcException


                }
            }
        }

        if (exception instanceof XProcException) {
            XProcException err = (XProcException) exception;
            loc = err.getLocator();
            if (err.getErrorCode() != null) {
                QName n = err.getErrorCode();
                qCode = new StructuredQName(n.getPrefix(),n.getNamespaceURI(),n.getLocalName());
            }
            if (err.getStep() != null) {
                message = message + err.getStep() + ":";
            }
        }

        if (loc != null) {
            if (loc.getSystemId() != null && !"".equals(loc.getSystemId())) {
View Full Code Here


  private File copyFile(File srcFile, File targetDir) {
    try {
      FileUtils.copyFileToDirectory(srcFile, targetDir);
    } catch (IOException e) {
      getLog().error("Unable to copy file: " + srcFile.getAbsolutePath() + " to " + targetDir.getAbsolutePath());
      throw new XProcException(e);
    }
    return new File(targetDir.getAbsolutePath(), srcFile.getName());
  }
View Full Code Here

        ostream.close();
       
        return pngFile;
      } catch (IOException e) {
        getLog().error("An error occured while transforming " + svgFile.getAbsolutePath() + " to " + pngFile.getAbsolutePath());
        throw new XProcException(e);
      } catch (TranscoderException e) {
        getLog().error("Unable to convert " + svgFile.getAbsolutePath() + " to png");
        throw new XProcException(e);
      }
    }
View Full Code Here

    matcher.match(doc, new RuntimeValue(fileRefsXpath));
    doc = matcher.getResult();
   
    if (copyTransform.hasErrors() && isFailOnErrorFlagSet()) {
      throw new XProcException("One or more images refered in the docbook were not found. Please see log for details.");
    }
   
    return doc;
  }
View Full Code Here

            if (uri == null && runtime.getDebug()) {
                System.out.println("\n--<document boundary>--------------------------------------------------------------------------");
            }
        } catch (URISyntaxException use) {
            use.printStackTrace();
            throw new XProcException(use);
        } catch (SaxonApiException sae) {
            sae.printStackTrace();
            throw new XProcException(sae);
        }// catch (FileNotFoundException fnfe) {
          //  throw new XProcException(fnfe);
        //}

        if (writer != null) {
View Full Code Here

            DocumentBuilder builder = cfgProcessor.newDocumentBuilder();
            builder.setLineNumbering(true);
            builder.setBaseURI(puri);
            parse(builder.build(source));
        } catch (SaxonApiException sae) {
            throw new XProcException(sae);
        }

        /*try {
            XdmNode cnode = readXML(".calabash", home.toASCIIString());
            parse(cnode);
View Full Code Here

                            long len) throws IOException {
                        properties.load(stream);
                    }
                });
            } catch (MalformedURLException mue) {
                throw new XProcException(XProcException.err_E0001, mue);
            } catch (IOException ioe) {
                throw new XProcException(XProcException.err_E0001, ioe);
            }
        }

        TreeWriter tree = new TreeWriter(runtime);
        tree.startDocument(step.getNode().getBaseURI());
View Full Code Here

                tree.addAttribute(_name, name);
                tree.addAttribute(_value, decode(val));
                tree.startContent();
                tree.addEndElement();
            } else {
                throw new XProcException(step.getNode(), "Badly formatted parameters");
            }
        }

        tree.addEndElement();
        tree.endDocument();
View Full Code Here

                String digits = val.substring(pos+1,pos+3);
                int dec = Integer.parseInt(digits, 16);
                char ch = (char) dec;
                result += ch;
            } catch (StringIndexOutOfBoundsException ex) {
                throw new XProcException("Badly formatted parameters", ex);
            } catch (NumberFormatException ex) {
                throw new XProcException("Badly formatted parameters", ex);
            }

            val = val.substring(pos+3);
        }
View Full Code Here

        String exePath = getStringProp("exePath");
        if (exePath == null) {
            exePath = System.getProperty("com.xmlcalabash.css.prince.exepath");
        }
        if (exePath == null || "".equals(exePath)) {
            throw new XProcException("Attempt to use Prince as CSS formater but no Prince exePath specified");
        }

        prince = new Prince(exePath, new PrinceMessages());

        String s = getStringProp("baseURL");
View Full Code Here

TOP

Related Classes of com.xmlcalabash.core.XProcException

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.