aspose file tools*
The moose likes XML and Related Technologies and the fly likes a problem about transforming Big xml to HTML 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 "a problem about transforming Big xml to HTML" Watch "a problem about transforming Big xml to HTML" New topic
Author

a problem about transforming Big xml to HTML

koji
Greenhorn

Joined: Dec 11, 2001
Posts: 1
dear all.
i try to get data from database
and then using sax api to generate xml file
like:
transformerHandler.setResult(new streamResult(response.getWriter()));
transformerHandler.startElement();
.
transformerHandler.characters(rs.getString("Mydata"),0,length);
.
transformerHandler.endElement();

and then if i try to access this servler/jsp
it will show the xml file
but usually it will show only half of the xml
and show the wrong message about syntax wrong in this xml........
i try to write in Dom or SAX api
but it will happened sometimes.........

best regards
koji
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Can you able to store the generated xml file into a a file instead of showing directly online ?
there may be chance that your xml data may contain some non-unicode characters which makes your browser to showonly half.
Try to store the xml file and see whether the xml is well formed.
Does your program throws any exception ??


Spritle Software Blogs
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
You can get a lot out of SAX exceptions but you have to handle them separately - do you set an errorHandler?
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: a problem about transforming Big xml to HTML