Hi
I am trying to look for a view name in create view statement and then replace this view name with VW_ in grants line in my ddl file .
cat dim_provider.sql | grep -i "create view" | while read f1 f2 f3 f4 f5 f6 f7 f8 f9
do
new_vw=` echo "$f3" | cut -d "." -f2... (32 Replies)
Hi I'm a newbie in unix and I'm having trouble in creating a script. I want to search for a pattern '_good' and insert new lines that contains '_bad', '_med', '_fail' while also ensure that the line contains _good is removed
here some of the data
UPDATE SCHOOL SET GRADE =... (1 Reply)
Hello, i am splitting files and sometimes the string of the pattern doesnt exist in the input file it starts for example with 00:00:01. So the output is completely desorganized, is there any way of putting a replacement string in the pattern so it will grab all the times from 00:**:** to first... (0 Replies)
I have a file file123.xml which looks like this
xmlEntry="username"="josh" <property="never_back_down">
phone="<178652>"
apn=property:address="wonderland"
xmlEntry="username"="jessica" <property="never_back_down">
phone="<178653>"
apn=property:address="wonderland"... (5 Replies)
Hi
I am having a code snippet
grant permission to all user
sts|ln|uSe|PSG
sajncht|se|Use|PPSPSG
psg|ln|use|TSPSG
sts_user.Me revoke
I need to change all occurance of use (uSe,Use,use) with USE. I am using the following sed command for this
sed 's//USE/g' s_sample.txt
Output: (7 Replies)
Hi there,
i am absolutely new in shell programming and especially using sed. What i want to do is to replace every emailaddress suffix with another. In my Testfile there is:
foo@bar.comMy attempt to replace every @<something>.<someotherthing> is:
sed 's/@+\.+/REPLACE/g' test.txt... (5 Replies)
HI Guys ,
Using UNIX ,I intend to check with correct file pattern Access_file_Record.YYYYMM in path /tmp
If the file exist in correct format come out from code .
If not found check with different file patterns for same month period YYYYMM ( Like Access_file_Record_YYYYMM.txt or... (8 Replies)
Hello Everybody,
I need a help in the below pattern matching and replacement issue
I have a file : emp.txt
21356 suresh 12/12/2012
23511 ramesh 11/06/2011
31456 biswajit 09/08/2013
53134 archan 06/02/2009
first field:- employee id, 2nd field is name and third field is date of joining
... (10 Replies)
Hi Techies,
I need a help in finding junk characters and remove them from a Datafile.
we have a file and it had crores of records like below
SGSN_MCC_MNC=01150
but sometime due to the issue with sending server we are getting some junk characters in the middle of data like below
... (6 Replies)
I'm trying to change a few programs in our environment. Basically We have hardcoded some server names and stuff, So I want some one to suggest me some UNIX gui tools that can be used to replace these..
I really don't want to deal doing this through the command line. I want to transfer the files... (3 Replies)
Discussion started by: sudden
3 Replies
LEARN ABOUT SUSE
xml::libxml::pattern
XML::LibXML::Pattern(3) User Contributed Perl Documentation XML::LibXML::Pattern(3)NAME
XML::LibXML::Pattern - XML::LibXML::Pattern - interface to libxml2 XPath patterns
SYNOPSIS
use XML::LibXML;
my $pattern = new XML::LibXML::Pattern('/x:html/x:body//x:div', { 'x' => 'http://www.w3.org/1999/xhtml' });
# test a match on a XML::LibXML::Node $node
if ($pattern->matchesNode($node)) { ... }
# or on a XML::LibXML::Reader
if ($reader->matchesPattern($pattern)) { ... }
# or skip reading all nodes that do not match
print $reader->nodePath while $reader->nextPatternMatch($pattern);
$pattern = XML::LibXML::Pattern->new( pattern, { prefix => namespace_URI, ... } );
$bool = $pattern->matchesNode($node);
DESCRIPTION
This is a perl interface to libxml2's pattern matching support http://xmlsoft.org/html/libxml-pattern.html. This feature requires recent
versions of libxml2.
Patterns are a small subset of XPath language, which is limitted to (disjunctions of) location paths involving the child and descendant
axes in abbreviated form as described by the extended BNF given below:
Selector ::= Path ( '|' Path )*
Path ::= ('.//' | '//' | '/' )? Step ( '/' Step )*
Step ::= '.' | NameTest
NameTest ::= QName | '*' | NCName ':' '*'
For readability, whitespace may be used in selector XPath expressions even though not explicitly allowed by the grammar: whitespace may be
freely added within patterns before or after any token, where
token ::= '.' | '/' | '//' | '|' | NameTest
Note that no predicates or attribute tests are allowed.
Patterns are particularly useful for stream parsing provided via the "XML::LibXML::Reader" interface.
new()
$pattern = XML::LibXML::Pattern->new( pattern, { prefix => namespace_URI, ... } );
The constructor of a pattern takes a pattern expression (as described by the BNF grammar above) and an optional HASH reference mapping
prefixes to namespace URIs. The method returns a compiled pattern object.
Note that if the document has a default namespace, it must still be given an prefix in order to be matched (as demanded by the XPath
1.0 specification). For example, to match an element "<a xmlns="http://foo.bar"</a>", one should use a pattern like this:
$pattern = XML::LibXML::Pattern->new( 'foo:a', { foo => 'http://foo.bar' });
matchesNode($node)
$bool = $pattern->matchesNode($node);
Given a XML::LibXML::Node object, returns a true value if the node is matched by the compiled pattern expression.
SEE ALSO
XML::LibXML::Reader for other methods involving compiled patterns.
AUTHORS
Matt Sergeant, Christian Glahn, Petr Pajas
VERSION
1.70
COPYRIGHT
2001-2007, AxKit.com Ltd.
2002-2006, Christian Glahn.
2006-2009, Petr Pajas.
perl v5.12.1 2009-10-07 XML::LibXML::Pattern(3)