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

RE: Transforming XML to XSL-FO by XSLT in java

Subject: RE: Transforming XML to XSL-FO by XSLT in java
From: Arulraj <p_arulraj@xxxxxxxxx>
Date: Thu, 6 May 2004 00:30:45 -0700 (PDT)
xml2fo
--- Jarno.Elovirta@xxxxxxxxx wrote:
> Xalan-J documentation has examples of this
>
<http://xml.apache.org/xalan-j/usagepatterns.html#basic>,
> did you look at them?
> 
> Cheers,
> 
> Jarno - Rotersand: Electronic World Transmission
> ([:SITD:] reconstruction)
> 

Hi Jarno,
   I wrote the code by using procedure given in above
site using java;

Java code follows;
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;

public class xml2fo
{
	public static void main(String[] args){ 
  
	try{
		TransformerFactory tFactory =
TransformerFactory.newInstance();
	
		Transformer transformer =
tFactory.newTransformer(new
StreamSource("Furniture.xsl"));
	
		transformer.transform(new
StreamSource("Furniture.xml"), new StreamResult(new
FileOutputStream("Furniture.fo")));
	
		
	   }
	catch(Exception e){
	
	}
  }
}

But it shows the error like this;
C:\xalan\samples\SimpleTransform>java xml2fo
[Error] Furniture.xsl:5:391: Document root element
"xsl:stylesheet", must mat
DOCTYPE root "xml".
[Error] Furniture.xsl:5:391: Element type
"xsl:stylesheet" must be declared.
[Error] Furniture.xsl:6:30: Element type "xsl:output"
must be declared.
[Error] Furniture.xsl:7:35: Element type
"xsl:variable" must be declared.

I am not able to find whether it is XSLT or Java
coding..

Regards
Arul


	
		
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

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.