Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–71 unchanged (71 lines)
72 currentElement().appendChild(node);
73 }
74
75 Element insert(Token.StartTag startTag) {
76 Tag tag = Tag.valueOf(startTag.name(), settings);
77 // todo: wonder if for xml parsing, should treat all tags as unknown? because it's not html.
78
79 Element el = new Element(tag, baseUri, settings.normalizeAttributes(startTag.attributes));
80 insertNode(el);
81 if (startTag.isSelfClosing()) {
82 if (!tag.isKnownTag()) // unknown tag, remember this is self closing for output. see above.
83 tag.setSelfClosing();
84 } else {
…lines 85–153 unchanged (69 lines)

After

…lines 1–71 unchanged (71 lines)
72 currentElement().appendChild(node);
73 }
74
75 Element insert(Token.StartTag startTag) {
76 Tag tag = Tag.valueOf(startTag.name(), settings);
77 // todo: wonder if for xml parsing, should treat all tags as unknown? because it's not html.
78 startTag.attributes.deduplicate(settings);
79
80 Element el = new Element(tag, baseUri, settings.normalizeAttributes(startTag.attributes));
81 insertNode(el);
82 if (startTag.isSelfClosing()) {
83 if (!tag.isKnownTag()) // unknown tag, remember this is self closing for output. see above.
84 tag.setSelfClosing();
…lines 85–154 unchanged (70 lines)

Before

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "parser"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "helper"
. "."
identifier "Validate"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "CDataNode"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "Comment"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "Document"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "DocumentType"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "Element"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "Node"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "TextNode"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "XmlDeclaration"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "Reader"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "StringReader"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
block_comment "/**\n * Use the {@code XmlTreeBuilder} when you want to parse"...
class_declaration
modifiers
public "public"
class "class"
identifier "XmlTreeBuilder"
superclass
extends "extends"
type_identifier "TreeBuilder"
class_body
{ "{"
method_declaration
type_identifier "ParseSettings"
identifier "defaultSettings"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
field_access
identifier "ParseSettings"
. "."
identifier "preserveCase"
; ";"
} "}"
method_declaration (+75 nodes collapsed)
method_declaration (+35 nodes collapsed)
method_declaration (+41 nodes collapsed)
method_declaration (+176 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration
type_identifier "Element"
identifier "insert"
formal_parameters
( "("
formal_parameter
scoped_type_identifier
type_identifier "Token"
. "."
type_identifier "StartTag"
identifier "startTag"
) ")"
block
{ "{"
local_variable_declaration (+22 nodes collapsed)
line_comment "// todo: wonder if for xml parsing, should treat all tags as"...
local_variable_declaration (+27 nodes collapsed)
expression_statement
method_invocation
identifier "insertNode"
argument_list
( "("
identifier "el"
) ")"
; ";"
if_statement (+53 nodes collapsed)
return_statement
return "return"
identifier "el"
; ";"
} "}"
method_declaration (+101 nodes collapsed)
method_declaration (+61 nodes collapsed)
method_declaration (+81 nodes collapsed)
block_comment "/**\n * If the stack contains an element with this tag's "...
method_declaration (+199 nodes collapsed)
method_declaration (+60 nodes collapsed)
method_declaration (+42 nodes collapsed)
} "}"

After

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "parser"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "helper"
. "."
identifier "Validate"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "CDataNode"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "Comment"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "Document"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "DocumentType"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "Element"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "Node"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "TextNode"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "XmlDeclaration"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "Reader"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "StringReader"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
block_comment "/**\n * Use the {@code XmlTreeBuilder} when you want to parse"...
class_declaration
modifiers
public "public"
class "class"
identifier "XmlTreeBuilder"
superclass
extends "extends"
type_identifier "TreeBuilder"
class_body
{ "{"
method_declaration
type_identifier "ParseSettings"
identifier "defaultSettings"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
field_access
identifier "ParseSettings"
. "."
identifier "preserveCase"
; ";"
} "}"
method_declaration (+75 nodes collapsed)
method_declaration (+35 nodes collapsed)
method_declaration (+41 nodes collapsed)
method_declaration (+176 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration
type_identifier "Element"
identifier "insert"
formal_parameters
( "("
formal_parameter
scoped_type_identifier
type_identifier "Token"
. "."
type_identifier "StartTag"
identifier "startTag"
) ")"
block
{ "{"
local_variable_declaration (+22 nodes collapsed)
line_comment "// todo: wonder if for xml parsing, should treat all tags as"...
expression_statement
method_invocation
field_access
identifier "startTag"
. "."
identifier "attributes"
. "."
identifier "deduplicate"
argument_list
( "("
identifier "settings"
) ")"
; ";"
local_variable_declaration (+27 nodes collapsed)
expression_statement
method_invocation
identifier "insertNode"
argument_list
( "("
identifier "el"
) ")"
; ";"
if_statement (+53 nodes collapsed)
return_statement
return "return"
identifier "el"
; ";"
} "}"
method_declaration (+101 nodes collapsed)
method_declaration (+61 nodes collapsed)
method_declaration (+81 nodes collapsed)
block_comment "/**\n * If the stack contains an element with this tag's "...
method_declaration (+199 nodes collapsed)
method_declaration (+60 nodes collapsed)
method_declaration (+42 nodes collapsed)
} "}"