This is an idea of mine. I think there should be an Xml++ java package, with extendible syntax like this:
<xmltag> <tagname>import</tagname> <class>xmlplusplus.parser.tag.import</class> <!--Uses the xmlplusplus.parser.tag.import derived from xmlplusplus.parser.tag derived from xmlplusplus.parser--> </xmltag> <xmltag> <tagname>include</tagname> <alias>import</alias> </xmltag> <import>AWT.xml</import> <AWTForm><!--Defined with xmltags in AWT.xml--> <layout>xmlplusplus.parser.tag.awt.GridBagParser?</layout> <button> <caption>Click me</caption> <layoutparam>NORTH</layoutparam> <handler>mypkg.onclick</handler> </button>...
Ok course, this is somewhat contrived, but you get the idea. To add a new tag, simply add a class derived from xmlplusplus.parser.tag and add some text to the xml. Some tags would be default, of course, but this could help in many systems, such as AiMl? used in AliceBot, or guis as shown above(especially menus).
Menu example:
<import>Awi</import> <import>AwtMenu?</import> <AwtMenu?>
<name>MyMenu?</name> <menu> <name>File</name> <menu> <name>Open</name> <event> <name>OnClick?</name> <!--Parent must register handler details--> </event> </menu>...
This would make it easy for the user to customize menus.
Comments welcome! --AnonymousDonor
Isn't this more... uh... UIML than XML++? It's not an extension to XML per se.
MSXML already deviates from the XML standard by supporting scripting inside XML/XSL.
I wonder how long it will be before there's a worm/virus/bomb written for MSXML. This obsession with "more functionality is better" is exactly what worries me about security. It can't help either with OnceAndOnlyOnce, nor RefactorMercilessly to have different kinds of scripts hooked in all over the place. -- DafyddRees
See also: OverhaulingStyleSheets, ColdFusionLanguage, GuiMarkupProposal