Package net.sf.saxon.trans

Examples of net.sf.saxon.trans.CompilerInfo


     */

    public Templates newTemplates(Source source)
        throws TransformerConfigurationException {

        CompilerInfo info = config.getDefaultXsltCompilerInfo();
        PreparedStylesheet pss = new PreparedStylesheet(config, info);
        pss.prepare(source);
        return pss;
  }
View Full Code Here


            if (doc==null) {
                return null;
            }

            final Configuration config = getConfiguration();
            CompilerInfo info = new CompilerInfo(config.getDefaultXsltCompilerInfo());
            PreparedStylesheet sheet = new PreparedStylesheet(config, info);

            try {
                sheet.setStylesheetDocument(doc, nodeFactory);
                templates = sheet;
            } catch (XPathException tce) {
                if (!tce.hasBeenReported()) {
                    try {
                        info.getErrorListener().fatalError(tce);
                    } catch (TransformerException e2) {
                        //
                    }
                }
                // don't know why we aren't allowed to just throw it!
View Full Code Here

            // We call liason.configure() and then liaison.setStylesheet()
            // so that the internal variables of liaison can be set up

            if (stylesheet instanceof FileResource) {
                File styleFile = ((FileResource) stylesheet).getFile();
                CompilerInfo info = config.getDefaultXsltCompilerInfo();
                templates = PreparedStylesheet.compile(new StreamSource(styleFile), config, info);

            } else {
                throw new BuildException("Saxon accepts the stylesheet only as a file",
                        getLocation());
View Full Code Here

     */

    protected XsltCompiler(Processor processor) {
        this.processor = processor;
        this.config = processor.getUnderlyingConfiguration();
        compilerInfo = new CompilerInfo(config.getDefaultXsltCompilerInfo());
    }
View Full Code Here

            // We call liason.configure() and then liaison.setStylesheet()
            // so that the internal variables of liaison can be set up

            if (stylesheet instanceof FileResource) {
                File styleFile = ((FileResource) stylesheet).getFile();
                CompilerInfo info = new CompilerInfo();
                info.setURIResolver(config.getURIResolver());
                info.setErrorListener(config.getErrorListener());
                info.setCompileWithTracing(config.isCompileWithTracing());
                PreparedStylesheet pss = PreparedStylesheet.compile(new StreamSource(styleFile), config, info);
                transformer = (Controller)pss.newTransformer();
                transformer.setInitialMode(initialMode);
                transformer.setInitialTemplate(initialTemplate);
                if (tracing) {
View Full Code Here

            if (doc==null) {
                return null;
            }

            final Configuration config = getConfiguration();
            CompilerInfo info = new CompilerInfo();
            info.setURIResolver(config.getURIResolver());
            info.setErrorListener(config.getErrorListener());
            info.setCompileWithTracing(config.isCompileWithTracing());
            PreparedStylesheet sheet = new PreparedStylesheet(config, info);

            try {
                sheet.setStylesheetDocument(doc, nodeFactory);
                templates = sheet;
View Full Code Here

     */

    public Templates newTemplates(Source source)
        throws TransformerConfigurationException {

        CompilerInfo info = new CompilerInfo();
        info.setURIResolver(config.getURIResolver());
        info.setErrorListener(config.getErrorListener());
        info.setCompileWithTracing(config.isCompileWithTracing());
        PreparedStylesheet pss = new PreparedStylesheet(config, info);
        pss.prepare(source);
        return pss;
  }
View Full Code Here

     */

    protected XsltCompiler(Processor processor) {
        this.processor = processor;
        this.config = processor.getUnderlyingConfiguration();
        compilerInfo = new CompilerInfo();
        compilerInfo.setURIResolver(config.getURIResolver());
        compilerInfo.setErrorListener(config.getErrorListener());
        compilerInfo.setCompileWithTracing(config.isCompileWithTracing());
    }
View Full Code Here

  public static String xslt(String xmlInput, FileInputStream xsltTrasform) throws Exception {
    String strResult = "";
    try {
      Source sourceInput = new StreamSource(new StringReader(xmlInput));
      Source styleSource = new StreamSource(xsltTrasform);
      CompilerInfo compilerInfo = getConfiguration().getDefaultXsltCompilerInfo();
      PreparedStylesheet sheet = PreparedStylesheet.compile(styleSource, getConfiguration(), compilerInfo);
      Controller controller = (Controller) sheet.newTransformer();
      StringWriter outWriter = new StringWriter();
      javax.xml.transform.Result result = new StreamResult(outWriter);
      try {
View Full Code Here

  public String xslt(FileInputStream xmlInput, String xsltTrasform) {
    String strResult = null;
    try {
      Source sourceInput = new StreamSource(xmlInput);
      Source styleSource = new StreamSource(new StringReader(xsltTrasform));
      CompilerInfo compilerInfo = getConfiguration().getDefaultXsltCompilerInfo();
      PreparedStylesheet sheet = PreparedStylesheet.compile(styleSource, getConfiguration(), compilerInfo);
      Controller controller = (Controller) sheet.newTransformer();
      StringWriter outWriter = new StringWriter();
      javax.xml.transform.Result result = new StreamResult(outWriter);
      try {
View Full Code Here

TOP

Related Classes of net.sf.saxon.trans.CompilerInfo

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.