Microsoft XML parser

Posted by Poromenos on Wed 24 Sep 2003 06:13 PM — 6 posts, 15,568 views.

Greece #0
Does anyone know if the Microsoft XML parser is included with windows or IE or whatever, or if the users have to install it themselves? I am trying to maybe write a plugin editor and it wouldn't help if every user had to download a multi-megabyte file to use it...
USA #1
No idea. You are probably better off looking at the XML parser code source in Python and building your own. I am sure IE has one, but like most stuff in IE, it probably won't do what you want, since it likely is designed to specifically load and parse the XML for display in IE. This is almost certainly not what you want. lol However, I can't be sure if this is the case. However, it may still be bad if someone tries to use your plugin, but they don't have IE installed. Forcing them to install IE is imho even worse.

---

As for actually editing things.. If you allow editing of the 'raw' xml, then incorporating Scintilla (www.scintilla.org) would work well, though it would work even better for the general script editing. The problem is, at least in the version I am using, scripting imbedded in XML doesn't display colored correctly. The fact that it appears in a CDATA block causes the XML parser in it to color everything gray. :P

Also, the existing language lexers for VB, Java and Perl don't include any extended color set. What do I mean by that? If you look in the definition files that set options for each script there will be stuff like:

keywordclass.vb=... followed by a mess of commands.

there is also:
keywordclass.vbnet=...
keywordclass.vbotherstatements=...

Each of these provides its own setting for color and font. The problem is that there is nothing for:

keywordclass.Mushclient=

or the like. Rebuilding the existing command set into the lexer, then letting people add any new ones into the definition file under this heading would be very useful. It is possible to add them all to keywordclass.vb, but is very ugly, since it means adding each one twice, once for the 'world.' version and one without that. I have been too lazy myself to dig into the code and figure out how to redesign the lexers. Especially since it would require changing the compiled parts for five different lexers: VB, Java, Perl, Python and XML. However, any editor for Mushclient kind of needs this.
Australia Forum Administrator #2
I just want to point out that you don't *have* to put your scripting in CDATA blocks. The plugin generator does that so they are easy to edit, but if you are using an XML editor you can remove the CDATA start and end tags, as long as you ensure that code inside the script changes:

< to &lt;
> to &gt;
& to &amp;

In fact, if you are using MUSHclient's built-in Notepad you can select some text and choose "Convert HTML special" to do just that. Also to edit your code you can do "Unconvert HTML special" to reverse the process.
Greece #3
It's just an idea, but I'm thinking of making it sort of graphical, not just a text editor... I found some nice parsers I can use that are written in VB, and I'll try to mess around with them, see what i can do...
USA #4
Hmm. Actually, I just checked, it is not just a CDATA issue, Anything in between the <script> and </script> tags is ignored for hilighting. SciTE simply doesn't automatically recognize and use the script's lexer when it finds code in XML. Of course, since this can be any number of languages inbedded in there, this may not be a surprise.

A graphical editor may be better in this respect, since you only need to script codecs to edit the code, the rest of the editor would handle triggers, etc. its own way and then simply export the script within the approriate tags.
Amended on Wed 24 Sep 2003 11:47 PM by Shadowfyr
Greece #5
Actually, while we're on the subject, I discovered much to my surprise, that AnyEdit (www.anyedit.org, open source editor with a sweet interface and MANY capabilities) is not only able to colour XML (and any other language you make a set for) correctly, but it also recognises VBScript and draws vertical lines to denote indentation... I'm sure you could get AnyEdit to color VBScript (and use the auto-completion) with a bit of editing of the included XML and VBScript files...