The problem is that parser for data in node 'n0' don't map key 'd0' to attr.name (color in this case).
So I must use 'd0' (generated temp value) as key to get node data when I should be able to use 'color' as a key. It creates more problems when I add more data to a node as id 'd0' will very likely point to different data.
I had a look on the source code and for some reason DataElementParser doesn't apply keys and just return data (DataElementParser line 84):
return data;
when parsers for most other elements applay keys .e.g. in NodeElementParser line 92 you can find code like this:
// Apply the keys to this object.
applyKeys(node);
return node;
So is there a reason for DataElementParser not applying keys or is it a defect?
Krzysztof
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm having problems with reading graphs like the following :
<?xml version="1.0" encoding="UTF-8"?>
<graphml ..>
<key id="d0" for="node" attr.name="color" attr.type="string">
<key id="d1" for="node" attr.name="name" attr.type="string">
<graph id="G" edgedefault="undirected">"
<node id="n0">
<data key="d0">green</data>
<data key="d1">Tom</data>
</node>
</graph>
</graphml>
The problem is that parser for data in node 'n0' don't map key 'd0' to attr.name (color in this case).
So I must use 'd0' (generated temp value) as key to get node data when I should be able to use 'color' as a key. It creates more problems when I add more data to a node as id 'd0' will very likely point to different data.
I had a look on the source code and for some reason DataElementParser doesn't apply keys and just return data (DataElementParser line 84):
return data;
when parsers for most other elements applay keys .e.g. in NodeElementParser line 92 you can find code like this:
// Apply the keys to this object.
applyKeys(node);
return node;
So is there a reason for DataElementParser not applying keys or is it a defect?
Krzysztof