I've always been ambivalent about macros in general, largely because I've seen people use their power to build monstrous houses-built-on-sand that were wonderful to behold but impossible to understand or debug or change.
I've also been very ambivalent about XML's macro mechanism (entity expansion), largely because we don't have a data model or processing model/tools for manipulating XML documents with entities unexpanded, and if you're going to make serious use of entities for any kind of data abstraction then you need to be able to read and write the unexpanded view of the document programmatically.
Michael Kay Saxonica
No.
But what makes entities offensive? Seems like the appropriate technology to use.
In Schematron, you can put the text portions into variables and combine them. But it is ultimately still just text substitution (macros). XSD doesn't provide simple macros, but it doesn't need to, because XML does with entities. The class-based programming movement in the 80s said that it would be better to figure out all the cool things that macros (ccp, m4, etc) were used for should be elaborated into first-class language constructs for better clarity, power etc. Hence C++ and OOP. XSD is the last gasp of this movement. The trouble is that there are uncountable things people can do with even simple macros: it severely restricts the expressivity (though not the power) of the language to not have any macro mechanism. (Schematron has 3 kinds of macros, if anyone is interested: simple macros with XPath variables and abstract rules, and parameterized macros with abstract patterns. You might say Schematron itself is a macro, actually...) Regards Rick
|