L
Lloyd Dupont
I have a class which looks like that:
class Stuff
{
Dictionary<string, object> properties;
List<Stuff> children;
}
I'm writing a home made XML 'serialization'.
I quote that, because it's not serialization, I'm writing the XML writer
myself (without System.Reflection).
I'm using a shema like that:
<stuff count=2 key1="value1" key2="value2" key3="value3">
<stuf>
.........
</stuff>
<stuf>
.........
</stuff>
</stuff>
where count = children.Count
and key1,2,3 are the keys in the properties dictionary and value1,2,3 their
values.
properties is to be filled by the user with whatever (s)he wants.
Now my problem is:
==============
As the user could put whatever (s)he wants in the properties dictionary
(s)he could as well create a key named 'count', therefore the 'count'
atribute will be present twice in the tag.
It's not a problem for my reader (which expect a first count followed by any
kind of attribute) but it might be for other people wanting to consume my
XML documents.
What do you think?
it's actually much easier this way...
(particularly because this sample output is far from the whole story)
class Stuff
{
Dictionary<string, object> properties;
List<Stuff> children;
}
I'm writing a home made XML 'serialization'.
I quote that, because it's not serialization, I'm writing the XML writer
myself (without System.Reflection).
I'm using a shema like that:
<stuff count=2 key1="value1" key2="value2" key3="value3">
<stuf>
.........
</stuff>
<stuf>
.........
</stuff>
</stuff>
where count = children.Count
and key1,2,3 are the keys in the properties dictionary and value1,2,3 their
values.
properties is to be filled by the user with whatever (s)he wants.
Now my problem is:
==============
As the user could put whatever (s)he wants in the properties dictionary
(s)he could as well create a key named 'count', therefore the 'count'
atribute will be present twice in the tag.
It's not a problem for my reader (which expect a first count followed by any
kind of attribute) but it might be for other people wanting to consume my
XML documents.
What do you think?
it's actually much easier this way...
(particularly because this sample output is far from the whole story)