From: <ad...@us...> - 2010-11-06 06:50:20
|
Revision: 1168 http://jtidy.svn.sourceforge.net/jtidy/?rev=1168&view=rev Author: aditsu Date: 2010-11-06 06:50:14 +0000 (Sat, 06 Nov 2010) Log Message: ----------- fixed and simplified fixXmlDecl (backported from java5 branch rev 1041) Revision Links: -------------- http://jtidy.svn.sourceforge.net/jtidy/?rev=1041&view=rev Modified Paths: -------------- trunk/jtidy/src/main/java/org/w3c/tidy/Lexer.java Modified: trunk/jtidy/src/main/java/org/w3c/tidy/Lexer.java =================================================================== --- trunk/jtidy/src/main/java/org/w3c/tidy/Lexer.java 2010-11-01 15:23:15 UTC (rev 1167) +++ trunk/jtidy/src/main/java/org/w3c/tidy/Lexer.java 2010-11-06 06:50:14 UTC (rev 1168) @@ -1678,22 +1678,11 @@ AttVal version; AttVal encoding; - if (root.content != null && root.content.type == Node.XML_DECL) - { + if (root.content != null && root.content.type == Node.XML_DECL) { xml = root.content; - } - else - { + } else { xml = newNode(Node.XML_DECL, this.lexbuf, 0, 0); - xml.next = root.content; - - if (root.content != null) - { - root.content.prev = xml; - xml.next = root.content; - } - - root.content = xml; + root.insertNodeAtStart(xml); } version = xml.getAttrByName("version"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |