Well, normally you would know what parameters are required for the node to
have. So, you would just write an E4X for that specific set of requirements
and if the requirements change you would replace the entire block. Just as
you would replace CSS in HTML template. That is I kind of fail to see the
point in making validation dynamic and construct it at runtime instead of
hardcoding it. What I mean is, since you know that you have to look for
@company and @location attributes - why would you provide them dynamically
and try to construct a validating expression instead of having that
expression hardcoded? As per my experience the hardcoded validation always
works better... - less errors, easier to read code. Compare this to
constructing DTD or XSL dynamically - usually it kind of defeats the purpose
of having those tools :)
Well, I think this all comes from the inherent to XML lack of typing and
structure. It is usually to generic for the data it serializes. There are
different solutions for transferring data preserving typing and stucture,
which are also more compact and often times easier to use - AMF and Protobuf
would be the most popular probably.

Reply via email to