The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to parse through a file and based on condition form another output file sivasu.india UNIX for Advanced & Expert Users 6 02-28-2008 04:59 AM
Creation of output file from list of file ganapati Shell Programming and Scripting 7 01-18-2008 07:55 PM
compare file size from a output file from a script moustik Shell Programming and Scripting 7 11-07-2007 10:17 AM
iconv and xmllint matrixmadhan UNIX for Advanced & Expert Users 3 10-06-2007 01:53 PM
appending to sed output of one file into the middle of file go4desperado Shell Programming and Scripting 5 02-05-2007 02:20 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-21-2008
damansingh damansingh is offline
Registered User
  
 

Join Date: May 2008
Posts: 11
xmllint output to a file

Hello All,
I have an XML file which has some errors in its tag definition according to an xsd. When i validate this xml file against an xsd, i wish to only take the errors in a file and not the complete xml. for eg.
Raman.xml has some errors induced in it.
RamanValidator.xsd holds the schema definition.
upon running the following utility:
xmllint --schema RamanValidator.xsd Raman.xml,
i get this as output:
ACT_D_03_07_08_T_12_41.xml:16: element CLI: Schemas validity error : Element 'CLI' [ST local, facet 'pattern']: The value '019145 58756' is not accepted by the pattern '[0-9]*'.
ACT_D_03_07_08_T_12_41.xml:35: element BBProduct: Schemas validity error : Element 'BBProduct' [CT 'BBProductType']: The element content is not valid.
ACT_D_03_07_08_T_12_41.xml:64: element CallingAndNetworkFeatures: Schemas validity error : Element 'CallingAndNetworkFeatures' [CT local]: The element content is not valid.
ACT_D_03_07_08_T_12_41.xml:10022: element BBProduct: Schemas validity error : Element 'BBProduct' [CT 'BBProductType']: The element content is not valid.
ACT_D_03_07_08_T_12_41.xml fails to validate

Now, i want this output only in a file.

Please help... Anticipating....
  #2 (permalink)  
Old 07-21-2008
ynilesh's Avatar
ynilesh ynilesh is offline
Registered User
  
 

Join Date: Oct 2007
Location: Bangalore, India.
Posts: 222
You can simply redirect output to a file with redirector.
command > {filename}
  #3 (permalink)  
Old 07-21-2008
damansingh damansingh is offline
Registered User
  
 

Join Date: May 2008
Posts: 11
It doesnt work Nilesh !!
It produces a zero byte file and the entire output is given as stdio only...

Must be some other way to do so ....
  #4 (permalink)  
Old 07-21-2008
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,958

Code:
command > output_file 2>&1

  #5 (permalink)  
Old 07-21-2008
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,958
use --noout option to suppress default xml output after parsing
  #6 (permalink)  
Old 07-21-2008
damansingh damansingh is offline
Registered User
  
 

Join Date: May 2008
Posts: 11
Thanks a ton for the trick matrixmadhan.
Closed Thread

Bookmarks

Tags
xml

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On




All times are GMT -4. The time now is 11:23 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0