Added @XMLText decorator supporting optional 'required' option
Hi Robin, please excuse all the unnecessary code changes inside existing files but I wasn't able to find a linter setting which preserved your code. The code of the newly added XMLText files should be self-explanatory.
Best regards, Robert
I had to find a way to define the value of instance variable name without having an option name in the XMLText decorator's interface (as it makes no sense to define a name for a XML text node).
As this assignment can only be done within the annotate function (where the key argument exists), which however is a static one, I saw no other chance than to go the way via the class prototype, which gives me access to its instance variables.
The only reason why we need a name property anyhow is to be able to output the name of it within the error message shown in cases, in which the XMLText decorator defines it to be required but actually has no value assigned to it.
Maybe you see a better way to solve it.
Maybe you see a better way to solve it.
So, guys, what's about this PR? Attribute with text node functional would be very helpful