porton 0 Posted August 8, 2018 Report Share Posted August 8, 2018 Is there an XML namespace for creating "macroses" (they receive arguments and create XML code from an XML template)? Also, what about conditionals (if-then-else) and probably loops (as in functional programming languages)? Quote Link to post Share on other sites
Ingolme 1,031 Posted August 8, 2018 Report Share Posted August 8, 2018 The closest thing you'll find is XSLT, but it will only work if passed through an XSLT parser. Most browsers have one built in, but if you're in a different environment it will have to load some tool or library to do it. XML does not do anything on its own, it always has to be interpreted by a program. Quote Link to post Share on other sites
porton 0 Posted August 8, 2018 Author Report Share Posted August 8, 2018 @Ingolme I know XSLT and know it well. I ask for code embedded into a regular XML file not about XSLT. Quote Link to post Share on other sites
porton 0 Posted August 8, 2018 Author Report Share Posted August 8, 2018 @Ingolme Also: I do not need that my XML would be understandable by a browser. Quote Link to post Share on other sites
Ingolme 1,031 Posted August 8, 2018 Report Share Posted August 8, 2018 XML does not have macros, it does not have conditionals or loops. It is hardly different than a plain text file. It does nothing until a program reads it. Quote Link to post Share on other sites
porton 0 Posted August 8, 2018 Author Report Share Posted August 8, 2018 @Ingolme I know that XML does not have macros. But it is quite possible to create an XML namespace which could act like a macro language for XML. I started this topic because I need to decide whether to create a new namespace (and its semantics) for this purpose, or whether there is already designed such a thing, so that I would not need to create new namespaces but use existing ones. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.