User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > Programming and Discussion
Register FAQ Members List Calendar Arcade Today's Posts

Reply
Thread Tools Display Modes
Unread 8 Mar 2003, 15:50   #1
pablissimo
Henry Kelly
 
pablissimo's Avatar
 
Join Date: Apr 2000
Posts: 7,374
pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Javascript/VBScript + XML

Right.

I have made a verra simple page which refreshes itself every minute or so á la JScript (though I can stretch to using BVScript if the next bit requires it).

The idea was to have the page load an XML document, which contains server info from QStat (which can output XML), I'm toying with something on the Edinburgh Uni network like.

Anyway, I've looked about and there don't seem to be any decent tutorials or example source about dynamically creating a document using XML and one or t'tother of the scripting languages. I can see doing it in ASP form being easier, but I don't want this to rely on using IIS.

So, there's two questions (almost there, for those of you who're glazing over):

1) Is there a good XML tutorial you know of regarding parsing and using the information in an XML document either in JavaScript or VBScript
2) Short of document.write-ing the whole thing each time, is there a way of creating HTML elements on the fly that'll parse? I've tried the object.insertHTML, insertAdjacentHTML etc functions, but when they output things like tables, images related to them don't bother themselves to load etc.

Question 1 is 'the main thing' though, 2 is insignificant.
__________________
You're now playing ketchup
pablissimo is offline   Reply With Quote
Unread 8 Mar 2003, 17:28   #2
Structural Integrity
Rawr rawr
 
Structural Integrity's Avatar
 
Join Date: Dec 2000
Location: Upside down
Posts: 5,300
Structural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriend
We're running an XML project at school ATM. But since we've only started with this project I don't know that much XML yet.

Anyway, do you want this information to be parsed on the client side, or do you have a server that will parse it?

At school we use a Tomcat server with Cocoon, and as far I've seen cocoon can import ANY XML source (if you write a driver for it (a simple java class)) and has it's own logic through interpreted Java.

If you mean client side - I have no idea.
Structural Integrity is offline   Reply With Quote
Unread 8 Mar 2003, 18:25   #3
pablissimo
Henry Kelly
 
pablissimo's Avatar
 
Join Date: Apr 2000
Posts: 7,374
pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Quote:
Originally posted by Structural Integrity
We're running an XML project at school ATM. But since we've only started with this project I don't know that much XML yet.

Anyway, do you want this information to be parsed on the client side, or do you have a server that will parse it?

At school we use a Tomcat server with Cocoon, and as far I've seen cocoon can import ANY XML source (if you write a driver for it (a simple java class)) and has it's own logic through interpreted Java.

If you mean client side - I have no idea.
I basically want a static .htm file on the client-side (there will be no server) to read and parse a given XML file. I got 'somewhere' with it, using Microsoft.XMLDOM as an activex object, but it wasn't overly successful.

All the tutorials on the net seem to be excellent for telling you how to write an XML file, but once it's in XML form they're not so hot on telling you how to get data back out of it again =/
__________________
You're now playing ketchup
pablissimo is offline   Reply With Quote
Unread 8 Mar 2003, 20:31   #4
wu_trax
Registered User
 
Join Date: Jan 2003
Posts: 4,290
wu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet society
so you want to tranform the xml-file into, lets say xhtml and display that in the browser?
that should be somehow possible with this xsl-stuff, but dont ask me how
__________________
im not tolerant, i just dont care.

Last edited by wu_trax; 8 Mar 2003 at 20:42.
wu_trax is offline   Reply With Quote
Unread 8 Mar 2003, 21:18   #5
MT
/dev/zero
Retired Mod
 
MT's Avatar
 
Join Date: May 2000
Posts: 415
MT is an unknown quantity at this point
i could be very wrong, but doesnt IE (and modern browser) apply XLST transformations automagically? Just ensure that the file references a valid XLST innit.
__________________
#linux : Home of Genius

<idimmu> ok i was chained to a desk with this oriental dude
MT is offline   Reply With Quote
Unread 8 Mar 2003, 21:21   #6
wu_trax
Registered User
 
Join Date: Jan 2003
Posts: 4,290
wu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet society
Quote:
Originally posted by MT
i could be very wrong, but doesnt IE (and modern browser) apply XLST transformations automagically? Just ensure that the file references a valid XLST innit.
yes, they do, i just wasted a few minutes of my life and tryed it. (well, IE does, opera doesnt) i dont know if i undestood the problem correctly though
__________________
im not tolerant, i just dont care.

Last edited by wu_trax; 8 Mar 2003 at 21:27.
wu_trax is offline   Reply With Quote
Unread 8 Mar 2003, 21:24   #7
MT
/dev/zero
Retired Mod
 
MT's Avatar
 
Join Date: May 2000
Posts: 415
MT is an unknown quantity at this point
An example for you pabbeh

http://www.vbxml.com/xsl/tutorials/i.../peoplexsl.xml

http://www.vbxml.com/xsl/tutorials/i...t_1/people.xsl

(click view souirce on the first, you will see its just a straightforward xml file with a
Code:
<?xml:stylesheet type="text/xsl" href="people.xsl"?>
type mcjobby
__________________
#linux : Home of Genius

<idimmu> ok i was chained to a desk with this oriental dude
MT is offline   Reply With Quote
Unread 8 Mar 2003, 22:34   #8
queball
Ball
 
queball's Avatar
 
Join Date: Oct 2001
Posts: 4,410
queball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so little
Re: Javascript/VBScript + XML

Quote:
Originally posted by pablissimo

1) Is there a good XML tutorial you know of regarding parsing and using the information in an XML document either in JavaScript or VBScript
http://www.w3schools.com/dom/default.asp looks good.

Quote:

2) Short of document.write-ing the whole thing each time, is there a way of creating HTML elements on the fly that'll parse? I've tried the object.insertHTML, insertAdjacentHTML etc functions, but when they output things like tables, images related to them don't bother themselves to load etc.
XSLT (with msxml:script) like wu_trax mentioned, either from (Java|VB)script or an <XML> tag.
queball is offline   Reply With Quote
Unread 8 Mar 2003, 23:10   #9
pablissimo
Henry Kelly
 
pablissimo's Avatar
 
Join Date: Apr 2000
Posts: 7,374
pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Cheers chaps, didnt think of that XSLT, it's exactly what I'm looking for.
__________________
You're now playing ketchup
pablissimo is offline   Reply With Quote
Unread 9 Mar 2003, 01:13   #10
pablissimo
Henry Kelly
 
pablissimo's Avatar
 
Join Date: Apr 2000
Posts: 7,374
pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Right, that's working swimmingly.

However, I now have a new query.


I know it seems a horribly insecure feature to add to a scripting language, but is there any way of having a script file, embedded in a page or not, run a program (eg. QStat) every say minute or so without having to resort to some kind of Task Scheduler buggery?

I've not done any scripting in a while, I know in VB it would have been something like Shell "qstat.exe" 'or something', but I can't seem to find a VBScript or JScript equivalent.

Thoughts?
__________________
You're now playing ketchup
pablissimo is offline   Reply With Quote
Unread 9 Mar 2003, 01:52   #11
queball
Ball
 
queball's Avatar
 
Join Date: Oct 2001
Posts: 4,410
queball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so little
Quote:
Originally posted by pablissimo
Right, that's working swimmingly.

However, I now have a new query.


I know it seems a horribly insecure feature to add to a scripting language, but is there any way of having a script file, embedded in a page or not, run a program (eg. QStat) every say minute or so without having to resort to some kind of Task Scheduler buggery?

I've not done any scripting in a while, I know in VB it would have been something like Shell "qstat.exe" 'or something', but I can't seem to find a VBScript or JScript equivalent.

Thoughts?
You just need the right ActiveX object, check out http://www.google.com/search?q=wscript+shell+run
and learn to use google and MSDN.
queball is offline   Reply With Quote
Unread 9 Mar 2003, 02:01   #12
pablissimo
Henry Kelly
 
pablissimo's Avatar
 
Join Date: Apr 2000
Posts: 7,374
pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Quote:
Originally posted by queball
You just need the right ActiveX object, check out http://www.google.com/search?q=wscript+shell+run
and learn to use google and MSDN.
I tried MSDN, using what little knowledge of full VB I had, i.e. looking for a Shell method or function, and managed only to come up with standard functions such as printing or opening the Run dialog.

And I also tried Google to no avail, not having realised searching for wscript would be equivalent to wsh.

Thanks for the help. The attempt at patronisation was unnecessary, unhelpful and unsuccessful.
__________________
You're now playing ketchup
pablissimo is offline   Reply With Quote
Unread 10 Mar 2003, 01:43   #13
(°>
lowly ensign
 
Join Date: Aug 2001
Posts: 66
(°> is an unknown quantity at this point
Depends on what sort of program and what sort of control you can have over it.
Simple VBScript
Code:
RUNTIMES=2
DELAY=5
PROGRAM= "C:\WINDOWS\NETSTAT.EXE"

FOR I=1 TO RUNTIMES
Dim oShell
Set oShell = WScript.CreateObject ("WSCript.shell")
oShell.run PROGRAM
Set oShell = Nothing

a=MINUTE(time)+DELAY
if a>59 then 
a=a-60
end if
while (MINUTE(now)<>a)
wend
NEXT
Just change the 3 variables to suit.Plus you can use Minute, Second and Hour or all 3 to get different delays.
(°> is offline   Reply With Quote
Unread 10 Mar 2003, 13:45   #14
pablissimo
Henry Kelly
 
pablissimo's Avatar
 
Join Date: Apr 2000
Posts: 7,374
pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Quote:
Originally posted by (°>
Depends on what sort of program and what sort of control you can have over it.
Simple VBScript
Code:
RUNTIMES=2
DELAY=5
PROGRAM= "C:\WINDOWS\NETSTAT.EXE"

FOR I=1 TO RUNTIMES
Dim oShell
Set oShell = WScript.CreateObject ("WSCript.shell")
oShell.run PROGRAM
Set oShell = Nothing

a=MINUTE(time)+DELAY
if a>59 then 
a=a-60
end if
while (MINUTE(now)<>a)
wend
NEXT
Just change the 3 variables to suit.Plus you can use Minute, Second and Hour or all 3 to get different delays.
I ended up using Shell.sleep(millisecondInterval) in a loop, works well and keeps the thread idle
__________________
You're now playing ketchup
pablissimo is offline   Reply With Quote
Unread 10 Mar 2003, 14:35   #15
(°>
lowly ensign
 
Join Date: Aug 2001
Posts: 66
(°> is an unknown quantity at this point
Quote:
Originally posted by pablissimo
I ended up using Shell.sleep(millisecondInterval) in a loop, works well and keeps the thread idle
ah yes in pure vbscript you could use sleep D'OH

I grabbed part of this code out of ASP where i can't get .sleep to work so use this stupid loop.
(°> is offline   Reply With Quote
Unread 10 Mar 2003, 15:45   #16
hinch
Banned
 
Join Date: May 2000
Location: Abducted By Aliens
Posts: 282
hinch is an unknown quantity at this point
pabs you need to parse the data and do **** with it? or just litterally display the thing on the page?
hinch is offline   Reply With Quote
Unread 10 Mar 2003, 15:59   #17
(°>
lowly ensign
 
Join Date: Aug 2001
Posts: 66
(°> is an unknown quantity at this point
If Qstat gives out XML pages then it also probably has an object which you could work with it from vbscript.
You'd have to look in the registry under classes_root for the program identifier then use create.object(pid) to open it and get a handle on the object.
My brain is too fried atm to think it out.
(°> is offline   Reply With Quote
Unread 10 Mar 2003, 16:17   #18
pablissimo
Henry Kelly
 
pablissimo's Avatar
 
Join Date: Apr 2000
Posts: 7,374
pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Hinch:

I used the QStat template function in the end, it made more sense, and worked beautifully. I've now got a nice HTA app that displays current server info for the server's we're running at i15 in shiny fullscreen so you can leave it on the server running and at a glance see what's going on.

I got very, very bored =/

Making a quick server query bot in mIRC now, I'd do it properly but I've other things to get on with, I'm designing some CS bots as well and trying to get a decent heuristic going for the pathfinding algo =)
__________________
You're now playing ketchup
pablissimo is offline   Reply With Quote
Reply



Forum Jump


All times are GMT +1. The time now is 22:25.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018