nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

check xml File is OK or not

This is a discussion on check xml File is OK or not within the Shell scripting forums, part of the Development/Scripting category; i have problem with xml processing I have a ftp server on which somebody is putting XML. By that XML ...

Register free or login to your existing account and remove all advertisements.


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Linux answers from nixCraft.


Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-09-2009, 11:34 AM
kasimani's Avatar
Senior Member
User
 
Join Date: Jul 2006
Location: India, Delhi
OS: CentOS, RedHat, Fedora, Ubuntu
Posts: 151
Thanks: 3
Thanked 1 Time in 1 Post
Rep Power: 4
kasimani is on a distinguished road
Send a message via Yahoo to kasimani
Question check xml File is OK or not

i have problem with xml processing

I have a ftp server on which somebody is putting XML. By that XML i am parsing the data and fetching in different files as our need.
Now problem is, when the XML is putting on FTP server, meanwhile my script tries to parse the XML, obviously, XML is not ok, so there will be parse error.

Now i want a method, that can check the XML file is fully written on FTP server after then my script should do any action on it, otherwise my php script should not do anything.

I am running all PHP's from a shell script at some seconds interval.
OS is Centos Linux 5.2

Pl. provide/help a script for above requirement.

Thanks in Adv.
Manish
Reply With Quote
  #2 (permalink)  
Old 04-09-2009, 12:16 PM
amitabh's Avatar
Contributors
User
 
Join Date: Jul 2008
Location: New Delhi
OS: FreeBSD
Posts: 98
Thanks: 0
Thanked 4 Times in 3 Posts
Rep Power: 4
amitabh has a spectacular aura about amitabh has a spectacular aura about amitabh has a spectacular aura about
Send a message via MSN to amitabh Send a message via Yahoo to amitabh Send a message via Skype™ to amitabh
Default

which version of PHP are u using? if its' PHP5, u can use the error handling mechanism (try...catch) to catch for malformed xml
Reply With Quote
  #3 (permalink)  
Old 04-09-2009, 01:14 PM
kasimani's Avatar
Senior Member
User
 
Join Date: Jul 2006
Location: India, Delhi
OS: CentOS, RedHat, Fedora, Ubuntu
Posts: 151
Thanks: 3
Thanked 1 Time in 1 Post
Rep Power: 4
kasimani is on a distinguished road
Send a message via Yahoo to kasimani
Default

PHP 5.2

but need shell script to accomplish goal
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Unix Shell: Check if Word exist in file or not LinuxCommandos Shell scripting 1 11-07-2008 02:50 AM
Check file exists on Remote Server sanjus Shell scripting 3 06-12-2008 06:05 AM
forced file check fsck smr36 Ubuntu / Debian 3 04-16-2008 09:23 AM
Command to Check Linux File System lacloai Getting started tutorials 3 05-14-2007 05:45 PM
script on how to check if the file exists warren Shell scripting 4 04-14-2006 05:51 PM


All times are GMT +5.5. The time now is 01:49 PM.


Powered by vBulletin® Version 3.8.4 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2009 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38