Bugs item #1444399, was opened at 2006-03-06 12:36 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116035&aid=1444399&group_id=16035
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Doctype problems Initial Comment: I am trying to write a servlet filter that reads in, transforms, and writes back out to the response. The process seems to add extra processing- instructions and attributes. I wrote a simple test case to illustrate the point. Below is the input, the test, and the result. In particular I'm confused by the <?doc... processing instruction and the xml:space attributes. Any insight as to where they're coming from and how I can prevent them from being part of the output stream would be appreciated. I am using Dom4J 1.6.1 and JDK 1.5.0_05 from apple. Regards, Dan Thiffault ---- Basic.xml Start ------ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http:// www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Test Page</title> </head> <body> <h1>Test title</h1> <form action="testAction" method="post"> <div> <input type="text" name="elementOne" value=""/> <input type="text" name="elementTwo" value=""/> </div> <div> <input type="submit" value="Submit"/> </div> </form> </body> </html> ---- Basic.xml End ------ ---- Dom4JTest.java Start ------ package com.checkernet.servlet; import junit.framework.TestCase; import org.dom4j.Document; import org.dom4j.DocumentException; import org.dom4j.io.SAXReader; /** * @author Dan Thiffault * @version 0.0.1 */ public class Dom4JTest extends TestCase { public final void testDocTypeLoading() { Document aDoc; SAXReader xmlReader = new SAXReader(); try { aDoc = xmlReader.read (ClassLoader.getSystemResourceAsStream("com/checkernet/servlet/ data/basic.xml")); } catch (DocumentException e) { throw new RuntimeException(e); } System.out.print(aDoc.asXML()); } } ---- Dom4JTest.java End ------ ----- Result Start -------- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http:// www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><?doc type="doctype" role="title" { XHTML 1.1 } ?><html xmlns="http://www.w3.org/1999/ xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="-//W3C//DTD XHTML 1.1//EN"><head profile=""><title>Test Page</title></head><body xml:space="preserve"><h1 xml:space="preserve">Test title</ h1><form action="testAction" method="post" xml:space="preserve" enctype="application/x-www-form-urlencoded"><div xml:space="preserve"> <input type="text" name="elementOne" value="" xml:space="preserve"></input> <input type="text" name="elementTwo" value="" xml:space="preserve"></input> </div><div xml:space="preserve"> <input type="submit" value="Submit" xml:space="preserve"></input> </div></form></body></html> ----- Result End ------- ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116035&aid=1444399&group_id=16035 ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ dom4j-dev mailing list dom4j-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dom4j-dev