aspose file tools
The moose likes Java in General and the fly likes Printing XML document in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Printing XML document in Java" Watch "Printing XML document in Java" New topic
Author

Printing XML document in Java

sailsjam
Greenhorn

Joined: Jul 05, 2001
Posts: 18
I am trying to print an XML document.I put the document on a JEditorPane but it has too many white space.It seems like JEditorPane doesnot know the XML format. What other way can I use to print the document.
Aj Manch
Ranch Hand

Joined: May 07, 2001
Posts: 50
If you are just interested in printing the XML document, you can open it in IE (I think 5 and above). IE already has a built-in parser and therefore formats it accordingly. You can print that out from there.
If that doesn't suffice your requirement, you can use XML4J or Xerces parser API to parse the XML document using Java and then you can do whatever you want.
Hope that helps.
AJ
bhuvan gupta
Greenhorn

Joined: Mar 26, 2001
Posts: 13
I think Object space dxml parser can be of better use for u here .... u can parse the XML string with the dxml parser and get the XML String back again using that .. the resulted XML String will be having proper indentation ...like XML being displayed in IE
Originally posted by Aj Manch:
If you are just interested in printing the XML document, you can open it in IE (I think 5 and above). IE already has a built-in parser and therefore formats it accordingly. You can print that out from there.
If that doesn't suffice your requirement, you can use XML4J or Xerces parser API to parse the XML document using Java and then you can do whatever you want.
Hope that helps.
AJ

 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Printing XML document in Java
 
Similar Threads
Printing XML document
printing html file
How to scroll in a JEditorPane
how can i print an xml document through dom api
Displaying document contents