[Htmlparser-cvs] htmlparser/src/org/htmlparser/lexer/nodes Attribute.java,1.17,1.18 TagNode.java,1.2
Brought to you by:
derrickoswald
From: <der...@us...> - 2004-02-09 02:12:55
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexer/nodes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9169/src/org/htmlparser/lexer/nodes Modified Files: Attribute.java TagNode.java Log Message: Rework character entity translation. See task 58599 enhance character reference translation. Decode now handles missing semi colons, encoding is more efficient, hexadecimal numeric character entity references are handled and both encoding and decoding make minimal use of substring(). Augmented the tests in CharacterTranslationTest significantly, and merged the Generate class into the tests. Added translate command scripts in bin, which read from stdin and write to stdout. Index: Attribute.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexer/nodes/Attribute.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Attribute.java 2 Jan 2004 16:24:53 -0000 1.17 --- Attribute.java 9 Feb 2004 02:09:44 -0000 1.18 *************** *** 580,584 **** // references, so convert all double quotes into " quote = '"'; ! ref = Translate.convertToString (quote); // JDK 1.4: value = value.replaceAll ("\"", ref); buffer = new StringBuffer (value.length() * 5); --- 580,584 ---- // references, so convert all double quotes into " quote = '"'; ! ref = Translate.encode (quote); // JDK 1.4: value = value.replaceAll ("\"", ref); buffer = new StringBuffer (value.length() * 5); Index: TagNode.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/lexer/nodes/TagNode.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** TagNode.java 25 Jan 2004 21:32:59 -0000 1.29 --- TagNode.java 9 Feb 2004 02:09:44 -0000 1.30 *************** *** 186,190 **** // convert all double quotes into " quote = '"'; ! ref = Translate.convertToString (quote); // JDK 1.4: value = value.replaceAll ("\"", ref); buffer = new StringBuffer (value.length() * 5); --- 186,190 ---- // convert all double quotes into " quote = '"'; ! ref = Translate.encode (quote); // JDK 1.4: value = value.replaceAll ("\"", ref); buffer = new StringBuffer (value.length() * 5); |