Merge pull request #668 from triska/xbrl
library(sgml): Correctly parse XML leaf nodes that are not text nodes.
This commit is contained in:
@@ -5877,7 +5877,10 @@ impl MachineState {
|
|||||||
indices: &mut IndexStore,
|
indices: &mut IndexStore,
|
||||||
node: roxmltree::Node,
|
node: roxmltree::Node,
|
||||||
) -> Addr {
|
) -> Addr {
|
||||||
if node.has_children() {
|
if node.is_text() {
|
||||||
|
let string = String::from(node.text().unwrap());
|
||||||
|
self.heap.put_complete_string(&string)
|
||||||
|
} else {
|
||||||
let mut avec = Vec::new();
|
let mut avec = Vec::new();
|
||||||
for attr in node.attributes() {
|
for attr in node.attributes() {
|
||||||
let chars = clause_name!(String::from(attr.name()), indices.atom_tbl);
|
let chars = clause_name!(String::from(attr.name()), indices.atom_tbl);
|
||||||
@@ -5914,9 +5917,6 @@ impl MachineState {
|
|||||||
self.heap.push(HeapCellValue::Addr(children));
|
self.heap.push(HeapCellValue::Addr(children));
|
||||||
|
|
||||||
result
|
result
|
||||||
} else {
|
|
||||||
let string = String::from(node.text().unwrap());
|
|
||||||
self.heap.put_complete_string(&string)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user