Page 1 of 2 12>
Topic Options
#151798 - 2005-11-18 01:09 AM Read and Write XML easily whithout COM
rtorrecillasg Offline
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
#151799 - 2005-11-18 01:26 AM Re: Read and Write XML easily whithout COM
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Yes, this has been suggested before.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#151800 - 2005-11-18 02:13 AM Re: Read and Write XML easily whithout COM
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
and yes, it's possible already.
_________________________
!

download KiXnet

Top
#151801 - 2005-11-18 09:10 AM Re: Read and Write XML easily whithout COM
rtorrecillasg Offline
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 Offline
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
#151803 - 2005-11-18 01:43 PM Re: Read and Write XML easily whithout COM
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
COM is even better than "native" support as any changes/enhancements that Microsoft makes to the COM objects are transparent to KiXtart and do not require KiXtart recoding. Thus, it is the more flexible implementation.
_________________________
There are two types of vessels, submarines and targets.

Top
#151804 - 2005-11-18 07:10 PM Re: Read and Write XML easily whithout COM
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
how?
well, writeline() and readline() are quite powerfull.
_________________________
!

download KiXnet

Top
#151805 - 2005-11-29 04:58 PM Re: Read and Write XML easily whithout COM
Stevie Offline
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 Offline
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
#151807 - 2005-11-30 07:26 PM Re: Read and Write XML easily whithout COM
Stevie Offline
Starting to like KiXtart
*****

Registered: 2002-01-09
Posts: 199
Quote:

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.



And I certainly understand the concern about duplicating existing functionality and I would agree that it should definitely be avoided wherever possible. But that leads back to my original question. Since existing libraries are available for most all of the current kixtart functions are you suggesting that those should be deprecated in future versions? Or are you saying that functions that are already included in the core language should stay and nothing new should be added where COM functionality exists? 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.

The real value of KiXtart to me has always been that it contains core functionality that reduces my need for COM reliance. 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. If most or all of my scripting tasks will require COM then what value does KiX have over VBScript? I really can't think of any except situational reasons (my company doesn't allow WSH on the desktops, etc.)

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. But, for example, as the IT community evolves from ini to registry to xml configuration (and I'm not inviting a flame war over which is "better") it would be nice for KiXtart to evolve with it in ways that VBScript can't or won't.


Edited by Stevie (2005-11-30 07:26 PM)
_________________________
Stevie

Top
#151808 - 2005-11-30 07:49 PM Re: Read and Write XML easily whithout COM
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I have to side with Stevie on this one ...

1) COM is good and COM is great - but COM wont be around forever.

2) There are lots of people with (like Richard coined) COM-a-phobia that can (otherwise) interpret the manual just fine and write some very cool scripts.

3) Some of the COM goodies are either WSH based or require extra add-ons (installs). As for WSH, some places no likey the WSH and as for add-ons - they can be a major pain-in-the-ass.

idk - there is much to be said for good old native functions. i'm not saying that embedding a few simplified XML functions is good or bad, just think we shouldn't abandon growing the language.

Top
#151809 - 2005-11-30 08:08 PM Re: Read and Write XML easily whithout COM
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Even though there may exist UDF libraries today that provide the functionality, not everyone is willing or able to maintain them should they break with future versions. Core functions (hopefully) would get more thorough testing and even if they did get broken, there would be an expectation that they would be fixed. UDFs come with a "use at your own risk" disclaimer.

Then there is also the general UDF-a-phobia.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#151810 - 2005-11-30 08:24 PM Re: Read and Write XML easily whithout COM
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
At the end-of-day - most of this stuff will be judgement call on Ruud's part anyways - Should something like ADSI be rolled into Kixtart ? of course not - even though we do have a few simple builtins that are ADSI-like (INGROUP for example) ...

Should the full XML DOM be implemented native in Kixtart ? of course not. But a few stream-lined XML functions maybe should be one day - when XML becomes more mainstream.

SOT: I do have a comment on growth though. Of the two "types" of growth (adding functions to the langauge versus adding to the language itself), wish there was more of the later on the horizon. My two cents.

Top
#151811 - 2005-12-01 11:02 AM Re: Read and Write XML easily whithout COM
Richard H. Administrator Offline
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
#151812 - 2005-12-01 09:42 PM Re: Read and Write XML easily whithout COM
Stevie Offline
Starting to like KiXtart
*****

Registered: 2002-01-09
Posts: 199
Quote:

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.




My disagreement with this line of thinking is that it can be extended to all existing kix functions. Just taking a quick look at some kix functions:

AddKey
AddPrinterConnection
AddProgramGroup
AddProgramItem
BackupEventLog
ClearEventLog
DelKey
DelPrinterConnection
DelProgramGroup
DelProgramItem
DelTree
DelValue
(didn't feel like looking past 'D')

We see that all of these functions are available in script via COM, so it certainly seems like there is quite a large amount of duplicated functionality. So if adding internal functions to Kix that call APIs directly is of "no real benefit", then it seems like you are espousing that all of these functions (A-Z) should be deprecated and each script should just contain a massive UDF header library that contains all of the functions that are currently covered by the core language. 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.

And on that point I don't think we'll ever agree.
_________________________
Stevie

Top
#151813 - 2005-12-02 09:09 AM Re: Read and Write XML easily whithout COM
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
right...
_________________________
!

download KiXnet

Top
#151814 - 2005-12-02 10:35 AM Re: Read and Write XML easily whithout COM
Richard H. Administrator Offline
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
#151815 - 2005-12-02 09:52 PM Re: Read and Write XML easily whithout COM
Stevie Offline
Starting to like KiXtart
*****

Registered: 2002-01-09
Posts: 199
Quote:

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.




I understand that argument completely and largely agree, though IMO the simpler functions would be useful for most scripters most of the time and if they needed more powerful/versatile functions they could delve into the API. An underlying assumption on my part is that these simpler functions could be created by leveraging existing APIs instead of having to build in complicated logic into the interpreter itself, which would necessitate the bifurcation of which you speak. Speaking of bifurcation, I must have eaten something a little off because I've been bifurcating for the last hour or so

As this topic has been pretty much beaten to death, at this point I will follow Richard's lead and I likewise promise not to post on this topic again... and there was much rejoicing...
_________________________
Stevie

Top
#151816 - 2005-12-02 10:19 PM Re: Read and Write XML easily whithout COM
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
ROFLMAO...
Top
#151817 - 2005-12-02 10:22 PM Re: Read and Write XML easily whithout COM
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Should I close this topic in case one of them falls off the wagon?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 2 12>


Moderator:  Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 686 anonymous users online.
Newest Members
Timothy, Jojo67, MaikSimon, kvn317, kixtarts2025
17874 Registered Users

Generated in 0.116 seconds in which 0.066 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org