10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I need to write a bash script that will parse some perforce log files, the log files will contain user login information, the script would need to pare the log, and check who logs in, and if the user is a superadmin, then the script will check the ip address to see which server the... (4 Replies)
Discussion started by: BostonRob
4 Replies
2. Shell Programming and Scripting
I have an XML tag like this:
<property name="agent" value="/var/tmp/root/eclipse" />
Is there way using awk that i can get the value from the above tag. So the output should be:
/var/tmp/root/eclipse
Help will be appreciated.
Regards,
Adi (6 Replies)
Discussion started by: asirohi
6 Replies
3. Shell Programming and Scripting
I have this script to parse some logs:
#!/bin/bash
id=$1
shift
sed "/(id=$id)/,/^$/!d" "$@"
Usage: ./script.sh 1234 logfile
The logs have an empty line before the logged events/timestamps -- most of the time. And this is my issue, since when there is no empty line, it will catch things... (4 Replies)
Discussion started by: KidCactus
4 Replies
4. Shell Programming and Scripting
Hi Guy's
Can I please get some help with this code.
I have xml feed file which rapidly changing temporary file and I need to capture the content of this file as soon as data arrives.
Example of the data
Required data output
Time is current time.
This is awk code that I have so far... (4 Replies)
Discussion started by: James_Owen
4 Replies
5. Shell Programming and Scripting
Hello Guys,
Please help with AWK problem. I have XML file which contains a list of messages for subjects.
Example of the messages:
, message=, message=, message=, message=, message=, message=, message=, message=
I want to use AWK to parse these xml messages but I am... (7 Replies)
Discussion started by: James_Owen
7 Replies
6. Shell Programming and Scripting
Well, that's what I'd do in bash :) Here's what I have so far:
import urllib2
from BeautifulSoup import BeautifulStoneSoup
xml = urllib2.urlopen('http://weatherlink.com/xml.php?user=blah&pass=blah')
soup = BeautifulStoneSoup(xml)
print soup.prettify()
but all it does is grab the html... (0 Replies)
Discussion started by: unclecameron
0 Replies
7. Shell Programming and Scripting
Hi,
I have to make an script according to these:
- I have couples of files like:
xxxxxxxxxxxxx.csv
xxxxxxxxxxxxx_desc.xml
- every xml file has diferent fields, but keeps this format:
........
<defaultName>2011-02-25T16:43:43.582Z</defaultName>
........... (2 Replies)
Discussion started by: Pluff
2 Replies
8. UNIX for Dummies Questions & Answers
Thanks in advance who can answer.
I have to make a small shell that after reading an XML file and extract the fields I create a text file with the same fields taken previously in tabular form.
I did this
parse.awk
----------------------
BEGIN {
FS=""
}
{
for(i=2; i<=NF; i+=2) {
... (1 Reply)
Discussion started by: mcarlo65
1 Replies
9. Shell Programming and Scripting
Hi All,
I have an xml file with the below format.
<a>111</a><b>222</b><c>333<c><d><e>123</e><f>234</f><d><e>456</e><f>789</f>
output needed is
111,222,333,123,234
111,222,333,456,789
nawk 'BEGIN{FS="<|>"}
{print a,b,c,e,f
a=""
... (7 Replies)
Discussion started by: natalie23
7 Replies
10. Shell Programming and Scripting
I need to know the way. I have got parsing down some nodes. But I was unable to get the child node perfectly. If you have code please send it. It will be very useful for me. (0 Replies)
Discussion started by: girigopal
0 Replies
XML::LibXML::RelaxNG(3) User Contributed Perl Documentation XML::LibXML::RelaxNG(3)
NAME
XML::LibXML::RelaxNG - RelaxNG Schema Validation
SYNOPSIS
use XML::LibXML;
$doc = XML::LibXML->new->parse_file($url);
$rngschema = XML::LibXML::RelaxNG->new( location => $filename_or_url );
$rngschema = XML::LibXML::RelaxNG->new( string => $xmlschemastring );
$rngschema = XML::LibXML::RelaxNG->new( DOM => $doc );
eval { $rngschema->validate( $doc ); };
DESCRIPTION
The XML::LibXML::RelaxNG class is a tiny frontend to libxml2's RelaxNG implementation. Currently it supports only schema parsing and
document validation.
METHODS
new
$rngschema = XML::LibXML::RelaxNG->new( location => $filename_or_url );
$rngschema = XML::LibXML::RelaxNG->new( string => $xmlschemastring );
$rngschema = XML::LibXML::RelaxNG->new( DOM => $doc );
The constructor of XML::LibXML::RelaxNG may get called with either one of three parameters. The parameter tells the class from which
source it should generate a validation schema. It is important, that each schema only have a single source.
The location parameter allows to parse a schema from the filesystem or a URL.
The string parameter will parse the schema from the given XML string.
The DOM parameter allows to parse the schema from a pre-parsed XML::LibXML::Document.
Note that the constructor will die() if the schema does not meed the constraints of the RelaxNG specification.
validate
eval { $rngschema->validate( $doc ); };
This function allows to validate a (parsed) document against the given RelaxNG schema. The argument of this function should be an
XML::LibXML::Document object. If this function succeeds, it will return 0, otherwise it will die() and report the errors found. Because
of this validate() should be always evaluated.
AUTHORS
Matt Sergeant, Christian Glahn, Petr Pajas
VERSION
2.0008
COPYRIGHT
2001-2007, AxKit.com Ltd.
2002-2006, Christian Glahn.
2006-2009, Petr Pajas.
perl v5.16.2 2012-10-22 XML::LibXML::RelaxNG(3)