[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

xml-source from COM to Xalan XLST-Transformation

Subject: xml-source from COM to Xalan XLST-Transformation
From: "Braumüller, Hans" <H.Braumueller@xxxxxxxxxxxx>
Date: Fri, 20 Dec 2002 13:12:39 +0100
xlst transformation
Hello,

please excuse my limit question to xlst. I hope the answer to following question can help also other people who get start with xalan passing dynamic xml-strings.

I am newbie at server side transformation, java and since several days i try to get run it.

Until now we use Tomcat and java-servlets transporting a COM-string in XML-Format by a java-com bridge to the browser IE6.

I try now with Xalan to do the stylesheet processing and serving html to the browser.

I get it run with static xml and xsl files, but not with the dynamic COM-String.

Any help and a tip where to look at resources and tutorials would be great.

My approach in the servlet:

// p_sXML is coming from JAVA-COM Bridge
// if i copy and save the p_sXML in a file xalan do the transformation
// if i try directly i get following error: java.net.MalformedURLException: no protocol: <?xml version="1.0" encoding="ISO-8 859-1"?>

public String  transform(String p_sXML)
{
    try
    {	

      TransformerFactory tFactory = TransformerFactory.newInstance();
	//ERROR: 	
      //StreamSource xmlSource = new StreamSource(p_sXML);
	//THE SAME AS FILE: OK
      StreamSource xmlSource = new StreamSource(new URL("file:D:/Tomcat_4.1/webapps/ho/disposition.xml").openStream());
      //StreamSource xslSource = new StreamSource(sXSLFile);
      StreamSource xslSource = new StreamSource(new URL("file:D:/Tomcat_4.1/webapps/ho/xsl/disposition.xsl").openStream());
      // Generate the transformer.
      Transformer transformer = tFactory.newTransformer(xslSource);
      // Perform the transformation, sending the output to the response.
      transformer.transform(xmlSource, new StreamResult(out));
    }
    catch (Exception e)
    {
     System.out.println("transform(): Exception"); 
     e.printStackTrace();
    }
}	


Greetings from Hamburg, Germany


Hans Braumüller 
Systementwickler Web-Design 
Hanse Orga AG
Sportallee 41 
D-22335 Hamburg 
Telefon: (+49) 040 51 48 08-62 
Telefax: (+49) 040 51 48 08-88 
E-Mail: h.braumueller@xxxxxxxxxxxx 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.