Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > problem: writing out an XML file always includes the commented DTD in the beginning. Why?

Reply
Thread Tools

problem: writing out an XML file always includes the commented DTD in the beginning. Why?

 
 
bronski
Guest
Posts: n/a
 
      02-16-2005
My problem is, I use javax.xml.Transform to write out a modified
Document object to a file. It has a dtd, and it is included every time
in the written file, no matter what. Why? How do I get rid of the
behaviour?

Here's the code:

try {
// Create a transformer
Transformer xformer =
TransformerFactory.newInstance()
.newTransformer();

// Write the DOM document to a file
Source source = new DOMSource(doc);
File newFile = new File(foo.xml);
Result result = new StreamResult(newFile);
xformer.transform(source, result);
} catch (TransformerConfigurationException e) {
System.out.println(e.getMessage());
} catch (TransformerException e) {
System.out.println(e.getMessage());
}

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bug? OutputCache directive processed when commented out Amil Hanish ASP .Net 1 08-25-2006 05:29 AM
XML file from one DTD to another DTD test Java 2 07-28-2006 08:48 PM
commented out form tag causing error Rod Snyder ASP .Net 2 09-14-2005 12:42 AM
BUG: commented out server side controls in html still run =?Utf-8?B?YWRvbGYgZ2FybGlj?= ASP .Net 1 11-22-2004 12:34 PM
Commented Code Not Treated As Commented Code Jim Heavey ASP .Net 1 12-02-2003 02:25 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57