aspose file tools*
The moose likes XML and Related Technologies and the fly likes Getting error in XSL Transformation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Getting error in XSL Transformation" Watch "Getting error in XSL Transformation" New topic
Author

Getting error in XSL Transformation

Vallidevi Appana
Greenhorn

Joined: Jun 30, 2006
Posts: 25
Hi all

I have one xhtml file and I want to tranform to another xhtml by changing some of the attributes.

So I am using xsl to do this transformation. I have used Xalan XSL Transformer for this.

My input xhtml document has doctype element.

<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>

When I ran Xalan, I got the following error:

(Location of error unknown)XSLT Error (javax.xml.transform.TransformerException)
: java.net.ConnectException: Connection timed out: connect


If I am removing the doctype element from the input xhtml file, then I am getting proper output.

What might be the problem??
Thanks in advance.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Originally posted by Vallidevi Appana:

What might be the problem??


You're specifying a DTD out on the Internet, and Xalan's trying to fetch it. Apparently that's not working on your machine, due to some network configuration issue.


[Jess in Action][AskingGoodQuestions]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18910
    
    8

What does that DOCTYPE mean? It says "Get the DTD from this location on the Internet: http://... and use it to validate the document", right? So the parser will try to get the DTD from that location.

And only when you use the DOCTYPE, you get the message "Connection timed out: connect". The logical conclusion is that the parser is trying to get the DTD from the Internet, but it can't connect to that location.

So that probably means your program can't connect to the Internet. (It's also possible that it just couldn't connect to http://www.w3.org, but that is less likely.)

If your program is running in an environment where you have to go through a proxy server to get to the Internet, then you have to tell the program where that proxy server is. Here's an article that explains that:

http://www.javaworld.com/javaworld/javatips/jw-javatip42.html

That is most likely the problem, but it could be something else.
Vallidevi Appana
Greenhorn

Joined: Jun 30, 2006
Posts: 25
Thank you very much for your valuable inputs.
I am working on this.....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting error in XSL Transformation