Asanka
Looks like the output of the XSL transformation is not well formed. Can you send the XSL stylesheet?

Yes
org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'F' (code 70) in prolog; expected '<'
at [row,col {unknown-source}]: [1,39]
The XSL transformation output looks like some plain text beginning with character "F".. Can you run the XSL transformation out of the ESB on the command line to verify this? I use a simple shell script with the content, and the attached SimpleTransform.java:

"java -Djavax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl -cp /home/asankha/bin/xalan-j_2_7_0/samples/SimpleTransform SimpleTransform $1 $2 $3"

asankha
--
Asankha C. Perera

WSO2 - http://wso2.org
http://esbmagic.blogspot.com

/*
 * Copyright 1999-2004 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 * $Id: SimpleTransform.java,v 1.11 2004/02/17 19:08:36 minchau Exp $
 */

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;

/**
 *  Use the TraX interface to perform a transformation in the simplest manner possible
 *  (3 statements).
 */
public class SimpleTransform
{
	public static void main(String[] args)
    throws TransformerException, TransformerConfigurationException, 
           FileNotFoundException, IOException
  {  

  String inputData = args[0];
  String xsltFile  = args[1];
  String outFile   = null;
  if (args.length == 3) {
     outFile = args[2];
  }

  // Use the static TransformerFactory.newInstance() method to instantiate 
  // a TransformerFactory. The javax.xml.transform.TransformerFactory 
  // system property setting determines the actual class to instantiate --
  // org.apache.xalan.transformer.TransformerImpl.
	TransformerFactory tFactory = TransformerFactory.newInstance();
	
	// Use the TransformerFactory to instantiate a Transformer that will work with  
	// the stylesheet you specify. This method call also processes the stylesheet
  // into a compiled Templates object.
	Transformer transformer = tFactory.newTransformer(new StreamSource(xsltFile));

	// Use the Transformer to apply the associated Templates object to an XML document
	// (foo.xml) and write the output to a file (foo.out).

        if (outFile == null) {
  	  transformer.transform(new StreamSource(inputData), new StreamResult(System.out)); //new FileOutputStream("birds.out")));
	} else {
          transformer.transform(new StreamSource(inputData), new StreamResult(new FileOutputStream(outFile)));
	}
	
  }
}

Reply via email to