Java Mailing List Archive

http://www.junlu.com/

Home » JDOM Projects »

[jdom-interest] Question about manipulating a document

Ramo At Skuff

2008-02-29

Replies: Find Java Web Hosting

Author LoginPost Reply
Hello,

i have a question about manipulating a document.
I have a method, something like this:

public void writeDocumentXML()
 {
         
      try {
     
     final XMLOutputter output2 = new
XMLOutputter(Format.getPrettyFormat());
          FileOutputStream fod2 = new
FileOutputStream(sqlFile);
        output2.output(xmlDoc, fod2);
        fod2.flush();
        fod2.close();
     } catch (IOException e) {
       
        e.printStackTrace();
     }

     
   
 }

The output is something like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="content-type" content="text/html" />.....

How can i manipulat the document, that i get something like this:

<?php phpinfo(); ?>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="content-type" content="text/html" />

So that the first line oft he document is not the xml-definition but the
php-definition?

Is there a way to handle it?

Many thanks!

Ramo

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.