#151798 - 2005-11-18 01:09 AM
Read and Write XML easily whithout COM
|
rtorrecillasg
Lurker
Registered: 2005-08-04
Posts: 4
|
Hello, I think that Kixtart should read and write XML easily without COM just like ini files.
|
Top
|
|
|
|
#151801 - 2005-11-18 09:10 AM
Re: Read and Write XML easily whithout COM
|
rtorrecillasg
Lurker
Registered: 2005-08-04
Posts: 4
|
How?
|
Top
|
|
|
|
#151802 - 2005-11-18 09:35 AM
Re: Read and Write XML easily whithout COM
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Quote:
Hello, I think that Kixtart should read and write XML easily without COM just like ini files.
Why?
What's the problem with using COM?
Search the forums on this site for some excellent work done by members to support XML files. These provide an number of APIs which makes XML support easy - just instantiate the UDFs and off you go.
If you have trouble locating the posts then post again in the "starters" forum asking for help.
|
Top
|
|
|
|
#151805 - 2005-11-29 04:58 PM
Re: Read and Write XML easily whithout COM
|
Stevie
Starting to like KiXtart
Registered: 2002-01-09
Posts: 199
|
If COM is so much better than native support, then why doesn't Ruud drop support for mapping drives, mapping printers, file i/o, registry i/o, and pretty much everything else KiX does. After all, all of that functionality is available via COM as well. And if that really is the preferred way to interact with the system then there is no need for internal support of these other functions either.
Of course I'm being a smart ass. But as I've maintained for a long time, what makes KiX as popular as it is has to do with so much functionality built into the core language. The best example is getting an environment variable from KiX and VB. In Kix, %var% is all it takes. In VBScript, you need multiple lines of script just to get the variable.
I think we can all agree that if the core language allows you to do a job in fewer keystrokes, and more intuitively, then that is the better option. What really is the decision point between what gets left in and left out is the level of complexity of the feature, how much larger the interpreter will become, and ultimately, if Ruud wants to support it or not.
As to the XML question in particular, it certainly wouldn't be practical to redesign the complete XML DOM. It's a very comprehensive structure and COM is more than adequate to handle those types of tasks. But for the simpler reads and writes (that don't return an array of nodes, for example) it seems that readxml() and writexml() would be ideal kix functions to complement the existing ini, registry, and file read and write operations. Simple functions wouldn't be too complicated to implement and wouldn't bloat the interpreter. So the only question is does Ruud want to do it or not? And as he's been quiet on this topic as its come up before, my magic 8-ball says "All signs point to NO". But we can always hope.
_________________________
Stevie
|
Top
|
|
|
|
#151806 - 2005-11-30 10:37 AM
Re: Read and Write XML easily whithout COM
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Quote:
I think we can all agree that if the core language allows you to do a job in fewer keystrokes, and more intuitively, then that is the better option.
I understand what you mean however I don't think that we'd all agree on that statement without a few major qualifications
There are libraries available for all sorts of discrete functions - XML, mail, network, maths, forms, 3D graphics, HTTP, HTML, updates, security, SNMP, AD, regular expressions and many more. These provide discrete functionality and are written by experts in their field - at least you'd hope they are anyway.
I don't think that it's a good idea to implement a crippled version of any functionality that is already available - it doesn't make sense. You surely want to use the libraries with the most recent enhancements and bug and security fixes and not have to wait until Ruud can update KiXtart?
The best compromise would be if Ruud added functions that simply called the APIs directly. That however adds no real benefit over loading an XML UDF library at the top of a script with your own ReadXML() and WriteXML() functions to call the APIs.
An XML support library to provide these sort of functions has already been written by board members and is available elsewhere - this will add the simplified function calls to KiXtart without requiring it to be hard-coded into the interpreter.
Rather than duplicating already available functionality into KiXtart we'd be better off improving the interface to COM to allow more objects to be used - event sinks and support for "out" variables for example. Promoting use of COM and providing extensive examples in the manual to help starters and COM-ophobics wouldn't hurt either.
|
Top
|
|
|
|
#151811 - 2005-12-01 11:02 AM
Re: Read and Write XML easily whithout COM
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Quote:
I'm not trying to put words in your mouth, I just don't understand how some duplicated functionality is OK and the rest is not.
There is probably very little duplication in fact. KiXtart will be calling existing Windows APIs to do the work. Most of the code in the interpreter will be handling parsing and management of KiXtarts own resources.
To take an example mentioned earlier, there is no code in the KiXtart interpreter to manipulate INI files. There is code to interpret the Read/WriteProfileString() function and pass the parameters off to the corresponding API.
Quote:
The real value of KiXtart to me has always been that it contains core functionality that reduces my need for COM reliance.
Yes and no. COM is a way of exposing APIs and objects such that they can be used in scripts. Adding a wrapper function in KiXtart may do the same thing, but you are still reliant on XMLDOM support and in addition you need to build the object management into the interpreter.
Quote:
If the evolution of KiXtart is moving towards tighter COM integration with nothing new added to the core language then I would say it has no real benefit over VBScript.
Not at all. Both KiXtart and VBScript provide access to COM, however the underlying languages have their own unique style and functionality. I personally despise the idiosyncrasies of VBScript and will do everything possible to code in KiX as a preference.
Quote:
If most or all of my scripting tasks will require COM then what value does KiX have over VBScript?
I think you have that backwards If KiXtart has access to all the same functionality as VBScript but with a superior interpreter, why would you ever use VBScript? As it is, sometimes I have to use VBScript because KiXtart has only partial support for things like COM automation objects. Now, that really annoys me.
Quote:
What draws most new users into KiX as a scripting tool is that it contains a large number of functions that don't require COM. For someone that has never scripted before, figuring out "that COM stuff" can be quite daunting.
I think that COM has a bit of mystique around it that means that people assume that it is complicated or difficult to use, however it's not. The major difficulties with COM stem from the fact that object documentation is not readily available or easily understandable to the uninitiated, and KiXtart does not have the functionality built-in to handle all the features of automation objects.
If the manual had a good beginners guide and extensive examples on how to use COM to manage common tasks then it would appear to be less voodoo and more mainstream.
There may be times when it makes sense to provide new functions to interface to Windows APIs to make it easier for starters, but it is a balance.
Just to close, if anyone needs XML file support now I *think* this link is the latest version of the community created XML functions: http://www.kixtart.org/ubbthreads/showfl...part=2&vc=1
|
Top
|
|
|
|
#151814 - 2005-12-02 10:35 AM
Re: Read and Write XML easily whithout COM
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Quote:
Since I don't believe that's what you're saying then it comes back to a completely arbitrary decision as to what is included and what is not. So, it really sounds like you're saying not that the language shouldn't support anything that is available via other means but rather you don't think this particular function should be included.
Yes, that's pretty close
There are people using well known stuff like IE COM, Office COM and KiXforms as well as more obscure objects. Adding KiXtart functions to access all of this functionality would be ridiculous.
That's why I said that there should be a balance - it's only arbitrary in that Ruud as the arbiter will determine whether it does KiXtart more good than harm in including it, whether the number of people who would use it warrants the effort to include it, and whether it is supportable going forward as the underlying protocols are enhanced.
XML is an order of magnitude more complex than INI file layout. Simple READ/WRITE functions are not sufficient to support the complexity, so my major concern is that support is not bifurcated.
If the end result is some XML files are read/writeable and some not or some XML functionality is available but some not or new functionality provided by XML enhancements cannot be accessed in KiXtart then scripters will need to disregard the built-ins and revert to COM to provide the functionality. This is already happening in a number of areas where the scripters needs are not supported by the built-in functions and we are having to find other methods and it lessens KiXtart.
Quote:
And on that point I don't think we'll ever agree.
LOL. That's fair enough, converts make me uncomfortable. I promise I won't post again on the subject.
|
Top
|
|
|
|
Moderator: Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart
|
0 registered
and 366 anonymous users online.
|
|
|