projects
/
tatoo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a new option to choose tree model at runtime.
[tatoo.git]
/
src
/
naive_tree.ml
diff --git
a/src/naive_tree.ml
b/src/naive_tree.ml
index
3cefe18
..
89b9e86
100644
(file)
--- a/
src/naive_tree.ml
+++ b/
src/naive_tree.ml
@@
-130,12
+130,11
@@
first_child=%a; next_sibling=%a; parent=%a }"
List.iter (do_attribute parser_ ctx) attr_list
and do_attribute parser_ ctx (att, value) =
List.iter (do_attribute parser_ ctx) attr_list
and do_attribute parser_ ctx (att, value) =
- let att_tag = QName.to_string (QName.attribute (QName.of_string att)) in
- start_element_handler parser_ ctx att_tag [];
+ start_element_handler parser_ ctx att [];
let n = top ctx in
n.data <- value;
n.kind <- Tree.NodeKind.Attribute;
let n = top ctx in
n.data <- value;
n.kind <- Tree.NodeKind.Attribute;
- end_element_handler parser_ ctx att
_tag
+ end_element_handler parser_ ctx att
and consume_closing ctx n =
if n.next_sibling != dummy then
and consume_closing ctx n =
if n.next_sibling != dummy then
@@
-170,14
+169,11
@@
first_child=%a; next_sibling=%a; parent=%a }"
and processing_instruction_handler parser_ ctx tag data =
do_text parser_ ctx;
and processing_instruction_handler parser_ ctx tag data =
do_text parser_ ctx;
- let pi = QName.to_string
- (QName.processing_instruction (QName.of_string tag))
- in
- start_element_handler parser_ ctx pi [];
+ start_element_handler parser_ ctx tag [];
let node = top ctx in
node.data <- data;
node.kind <- Tree.NodeKind.ProcessingInstruction;
let node = top ctx in
node.data <- data;
node.kind <- Tree.NodeKind.ProcessingInstruction;
- end_element_handler parser_ ctx
pi
+ end_element_handler parser_ ctx
tag
let character_data_handler _parser ctx text =
let character_data_handler _parser ctx text =
@@
-276,7
+272,7
@@
let output_escape_string out s =
let rec print_attributes ?(sep=true) out tree_ node =
if (node.kind == Tree.NodeKind.Attribute) then
let rec print_attributes ?(sep=true) out tree_ node =
if (node.kind == Tree.NodeKind.Attribute) then
- let tag = QName.to_string
(QName.remove_prefix node.tag)
in
+ let tag = QName.to_string
node.tag
in
if sep then output_char out ' ';
output_string out tag;
output_string out "=\"";
if sep then output_char out ' ';
output_string out tag;
output_string out "=\"";
@@
-313,7
+309,7
@@
let rec print_xml out tree_ node =
output_string out "-->"
| ProcessingInstruction ->
output_string out "<?";
output_string out "-->"
| ProcessingInstruction ->
output_string out "<?";
- output_string out (QName.to_string
(QName.remove_prefix node.tag)
);
+ output_string out (QName.to_string
node.tag
);
output_char out ' ';
output_string out node.data;
output_string out "?>"
output_char out ' ';
output_string out node.data;
output_string out "?>"