473,545 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XML/JDOM: Replacement for deprecated XMLOutputter ??

When I compile my java source with jdom b10 the compiler tells me that the instrcution

XMLOutputter outputter = new XMLOutputter(" ", true);
Outputter.outpu t(doc, new FileWriter("t.x ml"));

is deprecated.

What si the appropriate replacement of this deprecated command ?

Bernd
Jul 20 '05 #1
1 3445
JDOM b10 has much improved XML formatting - it makes it work switching.

These clips should work for you ...

import org.jdom.output .XMLOutputter;
import org.jdom.output .Format;

try {
XMLOutputter out= new XMLOutputter(Fo rmat.getPrettyF ormat());
out.output( elm , System.out);
} catch ( java.io.IOExcep tion ex ) {
System.out.prin tln("whatever") ;
}
be******@hotmai l.com (Bernd Oninger) wrote in message news:<ca******* ******@news.t-online.com>...
When I compile my java source with jdom b10 the compiler tells me that the instrcution

XMLOutputter outputter = new XMLOutputter(" ", true);
Outputter.outpu t(doc, new FileWriter("t.x ml"));

is deprecated.

What si the appropriate replacement of this deprecated command ?

Bernd

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3932
by: mali_djuro | last post by:
Hi all, i used JDOM to create XML file. first, i get data from database and create Document object. in some data i have quotas, so it makes replacment in content of elements. for example: if i have "Hi" in database, i will have &quot;Hi&quot; in content of element. And it is ok, because in xml does not exist ", at least i think that. After it i want...
0
2264
by: FilexBB | last post by:
Currently I use jdom-b9 version to parase xml with the following xml message <?xml version="1.0" encoding="UTF-8" standalone="no"?> ...... with the code like this SAXBuilder builder = new SAXBuilder(); InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("test.xml"); Document doc = builder.build(is);
2
6101
by: Praveen Chhangani | last post by:
Folks, I was wondering if it were possible to convert an org.jdom.doc to an org.w3c.doc document. Essentially what I have is an already parsed document using jdom and I would like to use the document object in another application that is expecting a DOM (w3c) document. If someone could perhaps, show me an example that would be very much
3
3012
by: Michael | last post by:
hello, I'm a java programmer, and my program will require to parse XML documents and extract data from it, then built a new XML document. Should JDOM or Xerces be the best for me? Please help. Thank you very much, Michael
3
15095
by: Bernd Oninger | last post by:
When I run the successfully compiled java source shown at the end I got a runtime error: Exception in thread "main" java.lang.NoClassDefFoundError: org/jdom/Content Where is the missing class ? I copied the newest jdom.jar from newest JDOM release b10 to the folder jdk\jre\lib\endorsed
0
1252
by: Tom | last post by:
When I build a JDOM document containing something like <glyph unicode="&#xe041;" glyph-name="A"> then this unicode attribute value is not preserved (maybe resolved or escaped?). I create such a document from scratch and write it with a modified XMLOutputter which do not escape such attribute values. Then I need to build it again from file....
2
5841
by: zhengwt | last post by:
I used JDOM.jar to process xml-based document. Recently, I meet such a problem that I can not solve. First, I use the following code generate xml text: Element root = new Element("Root"); Document doc = new Document(root); ... // add some elements appended to root XMLOutputter out = new XMLOutputter();
4
2123
by: Vijay Anandh | last post by:
Hi All, I am new to JDOM and I am currently coding a program to build xml files using JDOM. The size of the xml file which i am goin to build will be in the order of a few GB's( 1 to 5 GB). Will I be able to build such huge documents with JDOM?? Also if there are any resources on jdom benchmarking please let me know the links. ( BTW, I am...
1
4880
by: Mark Ingram | last post by:
Hi, I'm in the middle of upgrading our code with VC8, but when I include <dequeI get the following errors: warning C4995: 'gets': name was marked as #pragma deprecated warning C4995: 'sprintf': name was marked as #pragma deprecated warning C4995: 'vsprintf': name was marked as #pragma deprecated warning C4995: 'strcat': name was marked as...
0
7410
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7923
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7437
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5984
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4960
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1901
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1025
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
722
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.