File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Getting error in XSL Transformation

Vallidevi Appana

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' ''>

When I ran Xalan, I got the following error:

(Location of error unknown)XSLT Error (javax.xml.transform.TransformerException)
: 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

Joined: Jul 08, 2003
Posts: 24199

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

Joined: Oct 14, 2005
Posts: 19973

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, 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:

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

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:
subject: Getting error in XSL Transformation
It's not a secret anymore!