Examples of XSLTProcessor


Examples of mx4j.tools.adaptor.http.XSLTProcessor

   public RelationServiceAdaptor()
   {
      m_server = MBeanServerFactory.createMBeanServer("MyAdaptorTests");
      m_adaptor = new mx4j.tools.adaptor.http.HttpAdaptor();
      m_processor = new DefaultProcessor();
      m_xsltProcessor = new XSLTProcessor();
   }
View Full Code Here

Examples of mx4j.tools.adaptor.http.XSLTProcessor

        Log.redirectTo(new CommonsLogger());
        URI uri = new URI(StringUtils.stripToEmpty(jmxAdaptorUrl));
        adaptor = new HttpAdaptor(uri.getPort(), uri.getHost());

        // Set the XSLT Processor with any local overrides
        XSLTProcessor processor;
        try
        {
            processor = new XSLTProcessor();
        }
        catch (TransformerFactoryConfigurationError e)
        {
            System.setProperty("javax.xml.transform.TransformerFactory", XMLUtils.TRANSFORMER_FACTORY_JDK5);
            processor = new XSLTProcessor();
        }

        if (StringUtils.isNotBlank(xslFilePath))
        {
            processor.setFile(xslFilePath.trim());
        }

        if (StringUtils.isNotBlank(pathInJar))
        {
            processor.setPathInJar(pathInJar.trim());
        }

        processor.setUseCache(cacheXsl);

        adaptor.setProcessor(processor);

        // Set endpoint authentication if required
        if (login != null)
View Full Code Here

Examples of mx4j.tools.adaptor.http.XSLTProcessor

      Log.redirectTo(new MX4JLoggerMonolog(logger));
      MBeanServer server = adminAtt.getRawMBeanServer();
      adapter = new HttpAdaptor();
      server.registerMBean(adapter, getObjectName());

      XSLTProcessor processor = new XSLTProcessor();
      processor.setPathInJar("org/objectweb/speedo/jmx/xsl");
      processor.setUseCache(false);
      ObjectName processorName = new ObjectName("Server:name=XSLTProcessor");
      server.registerMBean(processor, processorName);

      server.setAttribute(getObjectName(),
              new Attribute("ProcessorName", processorName));
View Full Code Here

Examples of mx4j.tools.adaptor.http.XSLTProcessor

        Log.redirectTo(new CommonsLogger());
        URI uri = new URI(StringUtils.stripToEmpty(jmxAdaptorUrl));
        adaptor = new HttpAdaptor(uri.getPort(), uri.getHost());

        // Set the XSLT Processor with any local overrides
        XSLTProcessor processor;
        try
        {
            processor = new XSLTProcessor();
        }
        catch (TransformerFactoryConfigurationError e)
        {
            System.setProperty("javax.xml.transform.TransformerFactory", XMLUtils.TRANSFORMER_FACTORY_JDK5);
            processor = new XSLTProcessor();
        }

        if (StringUtils.isNotBlank(xslFilePath))
        {
            processor.setFile(xslFilePath.trim());
        }

        if (StringUtils.isNotBlank(pathInJar))
        {
            processor.setPathInJar(pathInJar.trim());
        }

        processor.setUseCache(cacheXsl);

        adaptor.setProcessor(processor);

        // Set endpoint authentication if required
        if (login != null)
View Full Code Here

Examples of org.apache.cocoon.components.xslt.XSLTProcessor

  {
    try {
      CharArrayWriter writer = new CharArrayWriter();
      StreamResult result = new StreamResult(writer);

      XSLTProcessor transformer
        = (XSLTProcessor)componentManager.lookup(XSLTProcessor.ROLE);

      transformer.transform(this, stylesheet, params, result);

      componentManager.release(transformer);

      return new XScriptObjectResult(xscriptManager, writer.toString());
    }
View Full Code Here

Examples of org.apache.cocoon.components.xslt.XSLTProcessor

  {
    try {
      CharArrayWriter writer = new CharArrayWriter();
      StreamResult result = new StreamResult(writer);

      XSLTProcessor transformer
        = (XSLTProcessor)componentManager.lookup(XSLTProcessor.ROLE);

      try {
          transformer.transform(this, stylesheet, params, result);
      } finally {
          componentManager.release(transformer);
      }

      return new XScriptObjectResult(xscriptManager, writer.toString());
View Full Code Here

Examples of org.apache.cocoon.components.xslt.XSLTProcessor

  {
    try {
      CharArrayWriter writer = new CharArrayWriter();
      StreamResult result = new StreamResult(writer);
     
      XSLTProcessor transformer
        = (XSLTProcessor)componentManager.lookup(XSLTProcessor.ROLE);
     
      transformer.transform(this, stylesheet, params, result);

      componentManager.release((Component)transformer);

      return new XScriptObjectResult(xscriptManager, writer.toString());
    }
View Full Code Here

Examples of org.apache.excalibur.xml.xslt.XSLTProcessor

     *
     * @return a <code>TransformerHandler</code> value
     */
    public TransformerHandler getTransformerHandler() throws ProcessingException
    {
        XSLTProcessor xsltProcessor = null;
        Source source = null;
        try {
            xsltProcessor = (XSLTProcessor)this.manager.lookup(XSLTProcessor.ROLE);
            source = this.resolver.resolveURI( this.systemId );

            // If the Source object is not changed, the
            // getTransformerHandler() of XSLTProcessor will simply return
            // the old template object. If the Source is unchanged, the
            // namespaces are not modified either.
            XMLFilter saveNSFilter = new SaveNamespaceFilter(namespaceURIs);
            return xsltProcessor.getTransformerHandler(source, saveNSFilter);

        } catch (ComponentException e) {
            throw new ProcessingException("Could not obtain XSLT processor", e);
        } catch (MalformedURLException e) {
            throw new ProcessingException("Could not resolve " + this.systemId, e);
View Full Code Here

Examples of org.apache.excalibur.xml.xslt.XSLTProcessor

     *
     * @return a <code>TransformerHandler</code> value
     */
    public TransformerHandler getTransformerHandler() throws ProcessingException
    {
        XSLTProcessor xsltProcessor = null;
        Source source = null;
        try {
            xsltProcessor = (XSLTProcessor)this.manager.lookup(XSLTProcessor.ROLE);
            source = this.resolver.resolveURI( this.systemId );

            // If the Source object is not changed, the
            // getTransformerHandler() of XSLTProcessor will simply return
            // the old template object. If the Source is unchanged, the
            // namespaces are not modified either.
            XMLFilter saveNSFilter = new SaveNamespaceFilter(namespaceURIs);
            return xsltProcessor.getTransformerHandler(source, saveNSFilter);

        } catch (ServiceException e) {
            throw new ProcessingException("Could not obtain XSLT processor", e);
        } catch (MalformedURLException e) {
            throw new ProcessingException("Could not resolve " + this.systemId, e);
View Full Code Here

Examples of org.apache.excalibur.xml.xslt.XSLTProcessor

                        PortalService service,
                        ContentHandler handler)
    throws SAXException {
        PreparedConfiguration config = (PreparedConfiguration)context.getAspectConfiguration();

        XSLTProcessor processor = null;
        Source stylesheet = null;
        SourceResolver resolver = null;
        try {
            resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
            stylesheet = resolver.resolveURI(this.getStylesheetURI(config, layout));
            processor = (XSLTProcessor) this.manager.lookup(config.xsltRole);
            TransformerHandler transformer = processor.getTransformerHandler(stylesheet);
            // Pass configured parameters to the stylesheet.
            if (config.parameters.size() > 0) {
                Map.Entry entry;
                Transformer theTransformer = transformer.getTransformer();
                Iterator iter = config.parameters.entrySet().iterator();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.