This is getting too complicated, IMO. If we want to allow specifying system property name as a source for a property value then
<min-size>${postgres.min.size:10}</min-size>
is the best. From the XML perspective this is the simplest and clearest way. Other formats are more complex and confusing.
Property value could come from:
- system property;
- some default value if the system property hasn't been specified or its value is null;
- specific value set by admin which should survive server restart;
- specific value set by admin which should not survive server restart.
Not sure if the last one is useful. Anyway the complete config could look like
<property-name system-property="property.name" default="d" permanent-user-value="puv" temp-runtime-value="trv"/>
temp-runtime-value (if we even want to support it), should it even be in the XML at all? If the server is re-started it will be ignored anyway.
permanent-user-value, if it's specified then why there have to be system-property and default? It's redundant, so it should be at least a choice (which is not supported for attributes in XSD, btw).
If it has to be a system property value than ${property.name:d} to me personally looks nicer than two attributes format.
So, if the value in XML is a (single) value that has to survive server restart then
<min-size>${postgres.min.size:10}</min-size>
is really the best. Disadvantage is it has to be a string-like type in the schema.
The configuration tool should provide a way to set the value to a system property or specific value.
IMO, things like changing the value of a property and at the same time the value of a system property should not be supported.
If there is a case when you need to this, I'd propose to change the system property and then refresh/re-initialize the property value.