porton Posted August 8, 2018 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)? Link to comment Share on other sites More sharing options...
Ingolme Posted August 8, 2018 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. Link to comment Share on other sites More sharing options...
porton Posted August 8, 2018 Author 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. Link to comment Share on other sites More sharing options...
porton Posted August 8, 2018 Author Share Posted August 8, 2018 @Ingolme Also: I do not need that my XML would be understandable by a browser. Link to comment Share on other sites More sharing options...
Ingolme Posted August 8, 2018 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. Link to comment Share on other sites More sharing options...
porton Posted August 8, 2018 Author 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now