Joined: 12 Dec 2007
|Posted: Sat Mar 08, 2014 6:10 pm Post subject: XML Parsing
|Would it be too much to ask for XML parsing as a tintin feature?
It could be implemented pretty simply:
1. If an <XML> start tag is received, wait for the corresponding </XML> tag.
2. If another <XML> start tag is received before the corresponding </XML> tag was received, automatically terminate the starting <XML> tag - at least on my MUD there are no nested XML strings.
3. if an <XML> start tag has not been recieved but some text is received, don't pass it to the XML parser.
Leave it up to the user to define #XML commands to handle received XML lines.
If the mud sends <roomname>The room's name</roomname> then user can define a handler:
#nop we could capture the roomname using this handler, do some things ...;
#map name %0;
#nop then like #function or #script, we could either set the value to ;
#nop return or we use #return to return it. The returned value could be ;
#nop modified, like adding ansi coloring, before being parsed as normal ;
#nop and displayed. ;