[Simpleweb-Support] sugestion for simple-xml library....
Brought to you by:
niallg
From: -=}\\*/{=- <rui...@gm...> - 2011-12-10 23:03:00
|
hi, i've been coding the last days and would like to suggest some method of inheriting from a parent node parent when specifying the "empty" parameter. http://simple.sourceforge.net/download/stream/doc/javadoc/org/simpleframework/xml/Attribute.html#empty() example of usage... i'm loading the server directly from a xml (configuration) file which will describe several contexts... i would like to be able to define default parameters in the ancestor/root nodes... another solution would be to be able to define free namespaces that declare defaults... maybe something like: <root> <namespacce-ignored-tag attr0="default value" attr1="other default value" if-not-distinguished-by-tag-name-maybe-by-a-special-attr-that-also-refers-a-xpath-to-the-defaultable-nodes="*"> <context/> <context attr0="overriding ancestor default"/> </namespacce-ignored-tag> </root> i think using the special attribute with xpath selection is better as it leaves the tag free for something like <defaults-for-public-servers SimpleXPath="*" or _SXP_="*" ... >, making the code more readable and allowing to specify the affected nodes (but not non descendants). both options would be nicer... <_SimpleDescendantDefaulter_...> or simply <_SDD_ ...> maybe option to provide the special attribute/element name to the Persister. converting variableNames into/from variable-names... would also be nice... if there is already a way to do these or similar please tell me. cheers, rui |