#5 Patch so TreeMLWriter does not write out null attributes.

closed-duplicate
nobody
None
5
2007-10-21
2007-07-20
Micah
No

TreeML defines attributes that each node in the tree can choose to implement. When TreeMLReader reads in a node which doesn't implement a certain attribute, it places a null object in the row of that attribute's column. However, When TreeMLWriter writes a graph that contains a null attribute, it introduces the attribute to the node and assigns its value to the string "null". This means that writing in and immediately writing out a TreeML file adds in a bunch of new attribute tags that were previously not there. I don't know whether or not this behavior is intentional, but it can be fixed by changing the line...

xml.tag(Tokens.ATTR, attr, vals, 2);

to...

if (vals[1] != null) {
xml.tag(Tokens.ATTR, attr, vals, 2);
}

Discussion

  • Jeffrey Heer
    Jeffrey Heer
    2007-10-21

    • status: open --> closed-duplicate