Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

XML SAXBuilder printing Document

Posted on 2008-10-23
3
Medium Priority
?
342 Views
Last Modified: 2013-12-15
Hello, This is a SAXBuilder builder.build document; Document schemaDoc = builder.build(schemaURL);
I would like to see the content of the schemaDoc.  What would be the code that would allow me to print the text.
I tried looking at the popup window (nodes) and THAT IS NOT THE WAY TO FIND ANY OF THE CONTEXT!.
thanks
0
Comment
Question by:chima
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:chima
ID: 22792033
Should the attached code snippet work for the schemaDoc?
I get DOM Document:[#document: null]

Earlier I had been looking at the schemaDoc, via the popup window and did see a text line that is several lines within the xml file.  So this gave me the confidence that the xml file is being read.
Document schemaDoc = builder.build(schemaURL);
 
//            Need to print/view the content of schemaDoc
            DOMOutputter domOutPutter = new DOMOutputter();
            System.out.print("\n DOM Document:" + domOutPutter.output(schemaDoc));
            System.out.print("\n Schema Doc:" + schemaDoc.getDocument());

Open in new window

0
 
LVL 17

Accepted Solution

by:
contactkarthi earned 2000 total points
ID: 22797372
in org.jdom.output.XMLOutputter there is an option to print the Document object as xml string

XMLOutputter.outputString(schemaDoc)



0
 

Author Closing Comment

by:chima
ID: 31509471
Worked like a charm, thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

660 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question