I am designing XML for some custom logging. There's a part in the logger where the developer can add name-value pairs to the log. I'm trying to decide how the XML should look. I'm trying to decide whether the name portion of the name value pair should be an attribute. (I think so). Here's what I have so far:
<ExtendedProperties>
<ExtendedProperty name="Name1">Value1</ExtendedProperty>
<ExtendedProperty name="Name2">Value2</ExtendedProperty>
</ExtendedProperties
The other option (that I know of) is to make the value name the node name:
<Name1>Value1</Name1>
<Name2>Value2</Name2>
I like the first method (attribute based) better because I can more easily describe the document with XSD, and I can see how you could use xpath or xquery to access all of the elements of type "ExtendedProperty". (The available names are not predefined -- they could be anything. )
However, I don't spend much time developing XML schemas. Does that look right to you guys? Is there anything else that I might want to consider?