xenocide0999
08-17-2009, 02:50 PM
Whats the easiest way to code a xml file parser that requires not much code? Right now every vb6 parser i have seen is 10+ kb, is there any way to simplify this to 1-2kb. (Why does it require so much code?)
Easiest way to parse xml files?xenocide0999 08-17-2009, 02:50 PM Whats the easiest way to code a xml file parser that requires not much code? Right now every vb6 parser i have seen is 10+ kb, is there any way to simplify this to 1-2kb. (Why does it require so much code?) Flyguy 08-17-2009, 03:39 PM You can use MSXML library, then you have less code, but a bigger install base. Why do you want to use as less code as possible? Less is not always better! dilettante 08-17-2009, 04:56 PM One issue with XML is you really aren't supposed to use it except for data interchange purposes. So that means you need to follow all of the rules or you risk having your program break when it parses something it can't handle that another program created. Now if you choose to use this bulky format for internal purposes you can make up or ignore any of the rules you want - but then it isn't XML, just XMLish. A limited parser for some kind of pidgeon-XML can potentially be much smaller than a full parser. Most common simple minded use of canned parsers parse the XML into some sort of DOM. The DOM itself has to be made up of a number of classes and collections that can be a sizable amount of code themselves. Adding XPath search capabilities can result in even more code. A parser is generally supposed to be able to validate XML documents against a schema. This means even more code. That's the funny part about XML. Using XML is like buying a large chest of tools for working on your car. If all you need to do is change spark plugs maybe you made a bad purchasing decision. kassyopeia 08-17-2009, 07:16 PM You can use MSXML library, then you have less code, but a bigger install base. Is that a serious concern, though? Unlike some of the MS* libraries, I find MSXML a real pleasure to work with, so writing one's own parser feels like re-inventing the wheel to me. mkaras 08-17-2009, 09:21 PM I have used the free XML parser component available from here on multiple instances. http://www.chilkatsoft.com/ChilkatXml.asp Worked very well for some simple reading and parsing of XML data files. mkaras Roger_Wgnr 08-17-2009, 10:38 PM Just to provide the option since this is a VB6 thread. There is a sample of a SAX Parser for VB6 in post 27 of this thread (http://www.xtremevbtalk.com/showthread.php?t=307417&page=2) Flyguy 08-18-2009, 03:18 AM Is that a serious concern, though? Unlike some of the MS* libraries, I find MSXML a real pleasure to work with, so writing one's own parser feels like re-inventing the wheel to me. I have seen a lot of posts in which people try to minimize the amount/size of external libraries. So it can be a concern to some of us. ;) And I've to add that for our clients we have a single runtimes installation which is used by all our applications. So if I decided to add XML functionallity then I either have to add it as a source code solution or use the minimal installed MSXML version as a base. |
EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum