Hi All,
I need to use the plugins.XmlReader.readXmlDocumentFromFile(_file_obj);
However, this only works when run from the server machine. When you try to access it through a client machine the file is not read.
It does however work in web client (because it works from the server).
Is there an altenative for this? Maybe another plugin or some other method.
Regards
Hareendra
It should work the same on both. Just keep in mind on Smart client it expects the document to also be local since it runs locally. If the file isn’t local, you can stream it down with the file plugin. If you do already have the file locally, then check to see if your getting any error messages when reading the document, or maybe running out of memory if its a big document.
PS. I usually start by converting all XML to JSON since it is much easier to work with, so you could just read it as a string and convert it to JSON.
Hi goldcougar,
Well the file is not saved locally. It is currently saved in a location on the server.
goldcougar:
Just keep in mind on Smart client it expects the document to also be local since it runs locally
Are you suggesting that we save the file locally? Isn’t that an issue, since every time the program is run, the file will have to be saved on the client machine.
goldcougar:
If the file isn’t local, you can stream it down with the file plugin
Can you please explain this a little further?
There is a plugin from IT2B which allows me to save the file in the server machine. It is through this plugin that I overcame the limitations. Isn’t there a similar plugin that I can use to read the file?
Regards
Hareendra
The File plugin that ships with Servoy does streaming to and from the server as well from the 5.2.x branch forward.
also, Why use the XMLReader plugin? The native XMl support in JavaSCript (see JSLib > XML/XMLList) is way more powerfull.
Paul