File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes How to read XML file offline using a browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "How to read XML file offline using a browser" Watch "How to read XML file offline using a browser" New topic
Author

How to read XML file offline using a browser

Jack Bush
Ranch Hand

Joined: Oct 20, 2006
Posts: 235
Hi All,

I am having difficulty opening up XML files offline (not connected or Internet/behind a proxy server) using Internet Explorer as it returns the following message:

The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
The server did not understand the request, or the request was invalid. Error processing resource 'http://www.w3.org/TR/xhtm...


Below is the snippet of the XML document I am trying to open:

Firefox can open the same document but as flat file which looses some of the hierachical tree structure and cannot track the source of the nodes properly.
I would like to read its content the same way as an XML editor would, without having to purchase one since I only need it for viewing purposes.
I have been told that by changing the PUBLIC to SYSTEM to reference a local drive would resolve this but do not have the instruction.
Any assistance would be much appreciated.

Thanks a lot,
Jack




William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
Have you tried Open Office? It seems to display XML rather nicely.

Bill
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
I have been told that by changing the PUBLIC to SYSTEM to reference a local drive would resolve this but do not have the instruction.



The instruction is change PUBLIC to SYSTEM.

This "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" should be replaced with "C:\\SomeDirectoryOnYourPC\\xhtml1-transitional.dtd".
Jack Bush
Ranch Hand

Joined: Oct 20, 2006
Posts: 235
Hi Frank,

Thank you for responding to my threat.

The following changes was made to the original C:\Tmp\CAR.xml and having downloaded xhtml1-transitional.dtd to e:\\TMP as suggested:

<!DOCTYPE html SYSTEM "-//W3C//DTD XHTML 1.0 Transitional//EN" "e:\\TMP\\xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml"><head><script type="text/javascript">
.....

Now the error output is slightly different:

The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.

--------------------------------------------------------------------------------

The character '>' was expected. Error processing resource 'file:///C:/Tmp/CAR.xml'. Line 2, Position 64

<!DOCTYPE html SYSTEM "-//W3C//DTD XHTML 1.0 Transitional//EN" "e:\\TMP\\xhtml1-transitional.dtd">
------------------...

Any ideas on why this is occurring?

Thanks a lot,

Jack
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to read XML file offline using a browser