XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Mike JordanSubject: Reading XML Files Across Network
Author: Mike Jordan
Date: 08 Mar 2009 10:54 PM

A few months ago, Minollo helped me create a script that would pull data out of my XML log files. This works great when I copy the files to my hard drive from the server that actually creates the XML logs. I have tried but I can not figure out how to have the script read across the network, either with a mapped drive or with the network path.

This from the script works fine for local files:

<myEvents> {
for $event in collection("file:///c:/a?select=log*.xml")//DropEvent
where $event/Source="RedirectedEvent RedirectedEvent"
return
<event> {
$event/Station,
$event/GPowerCallId,
$event/AgentId,
$event/AgentName,
$event/OrigDateTime
} </event>
} </myEvents>

The location on the network that I'm trying to reach is a shared folder on a server namned Ringo. The network path I tried was \\Ringo\logfiles\log*.xml

I've also mapped x:\ to that path as well. I can get to the directory if I click on drive x: but not from within the script. Since I have about 900 megs of log files created each day, I don't want to have to copy them to my harddrive when I want to run my report. Is it possible to read across the network like I'm trying to do?

Thanks

Mike

Ho

Postnext
Minollo I.Subject: Reading XML Files Across Network
Author: Minollo I.
Date: 08 Mar 2009 11:09 PM
Have you tried...
for $event in collection("file:////Ringo/logfiles?select=log*.xml")//DropEvent

Postnext
Mike JordanSubject: Reading XML Files Across Network
Author: Mike Jordan
Date: 08 Mar 2009 11:42 PM
I'm pretty sure I did, Minollo. I tried both forward slashes, back slashes and combination of slashes. But I tried so many different ways, I can't say for sure that I did try it exactly that way, so I will do that tomorrow. If it should work and something like your examplet is how it should be, then that is good to know.

Thanks

Mike

Postnext
Mike JordanSubject: Reading XML Files Across Network
Author: Mike Jordan
Date: 09 Mar 2009 01:47 PM
I tried your suggestion this morning and it didn't work. Since I know that XQuery is case sensitive, I made sure I had the proper case as well (I still tried it several different ways).

When I put the network name to the computer I was working with in place of the remote server, it worked. Here is that test query:

<RedirectEvents> {
for $event in collection("file:////Krial/C$/XML Files?select=GPowerServerASAI_Trace2009-03-09*.xml")//DropEvent


If I replace Krial with Ringo (Ringo being the remote server where I have a log file in the XML folder on it's C: drive) I get the following error:

[DataDirect][XQuery][err:FODC0004]Collection URI "file:////Ringo/C$/XML%20Files" does not reference a directory.

I tried several difference variations of this as well. Any other ideas?

Thanks

Mike

Postnext
Minollo I.Subject: Reading XML Files Across Network
Author: Minollo I.
Date: 09 Mar 2009 01:58 PM
Are both Krial and Ringo Windows boxes? In that case, I wouldn't expect directory/server name case to matter.

Is there any access privilege difference between the two machines?

Postnext
Mike JordanSubject: Reading XML Files Across Network
Author: Mike Jordan
Date: 10 Mar 2009 01:28 AM
Krial is the name of my workstation. It's a XP Pro computer. Ringo is a Windows 2003 R2 server that runs the applications that generate the XML logs I'm trying to read.

I have administrator rights on both and my login has Network Admin and Domain Admin rights. XQuery is running on my XP Pro computer under my login. The folder on Ringo where the XML files are kept is set up as a shared folder. I can map to the drive from Krial and also browse to it with no problems.

I suspect that it's just my formatting or something I'm over looking or how XQuery is looking at the path that I don't understand. I'll try using a folder that is completely wide open to see if I get anything different or the same error message.

Thanks

Mike

Postnext
Minollo I.Subject: Reading XML Files Across Network
Author: Minollo I.
Date: 10 Mar 2009 11:27 AM
Not that it helps you much, but I did try using the syntax I suggested you, and pointing to a remote server; and it worked fine.

Which JVM version are you using? And which DataDirect XQuery version?

Posttop
Mike JordanSubject: Reading XML Files Across Network
Author: Mike Jordan
Date: 10 Mar 2009 01:22 PM
If it works for you, then that just shows it's something I'm doing wrong. Which doesn't supprise me.

I'm using DataDirect XQuery 4.0 (R056804)
JVM is 1.6.0_03

I'm using Stylus Studio 2009.

I did try it on a folder on the C: drive of the server that I set everyone to having full rights, just to see if there was something in a inheritated permissions that was messing with it. It didn't make any difference. I also tried it using both the IP address of the server and the computer name in case it was a DNS issue and XQuery wasn't finding the server name.

Is there a simple command that I can test with to just pull a directory of a folder rather than using the script to read XML files? Maybe if I can get something simple to work then I can add in the script.

Thanks

Mike

 
Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.