Hi
I need one clarication..
I have an xml having many entries like this..
<Cust_Name>Tom Cruise</Cust_Name>
I want to rename this to
<Cust_Name>TEST</Cust_Name>
Pls let me know how to do it..
I was trying some basic commands like
grep 'Cust_Name' * | tr '>' ',' | tr '<' ... (2 Replies)
Hello Guys,
I have this requirement with several hundred files.
I have this first set of xml's files with the following tags spread across the file
FILE in SET A
<Name>Lion</Name>
<Age>15</Age>
.....
....
...
<Date>2009-12-12</Date>
Now i have this another set of files which... (5 Replies)
Hi,
I'd like to use sed in order to replace %20 and other "special" characters that are represented with % and some number combination in xml file. Typical line looks like this:
/Users/imac1/Music/iTunes/iTunes... (6 Replies)
I am not sure how to approach this find/replace using a shell script. Any help or guidance appreciated.
I want to find this:
<objects/>
<thumb>thumb_0001.jpg</thumb>
<preview>preview_0001.jpg</preview>
And replace with something like this:
<objects>... (1 Reply)
Hello,
I have an xml file whose contacts are like below:
<Node>Apple
<B>Value1</B>
<B>Value2</B>
<B>Value3</B>
</Node>
<Node>Mango
<B>Value1</B>
<B>Value2</B>
<B>Value3</B>
</Node>
<Node>Apple
<B>Value1</B>
<B>Value2</B>
<B>Value3</B>
</Node>
<Node>Bannana (3 Replies)
Please help me, wasted hrs:wall:, to find this soulution:-
I need a command that will work on file (xml) and replace multiple occurrence (more than 2 times)
Examples
1. '==='
2. '===='
3. '======='
should be replaced by just '=='
Note :- single character should be replaced. (=... (13 Replies)
Hi All,
My XML file looks like below:
<logEvent xsi:type="logservice:LogEvent" timestamp="1394713811052" severity="3" messageCode="TM_6228" message="Writing session output to log file ." user="" stacktrace="" service="" serviceType="IS" clientNode="dev" pid="712" threadName="DIRECTOR"... (3 Replies)
As per the requirement I need to replace XML tag with old to new on one of the XML file.
Old<com : DEM>PHI</com : DEM>
New<com : DEM>PHM</com : DEM>
Please someone provide the sed command to replace above mentioned old XML tag with new XML tag (2 Replies)
I need a way to to check if a value in a file that has this XML format is less than or equal to current system date/time. if it is I need to override it with a future date/time:
Here is the data sample:
<?xml version="1.0"... (1 Reply)
Dear Unix guru,
I have a .XML file which is being used to load data to oracle. This file comes on unix box and one of the tag in xml is oracle key word. I want to find that tag and replace with new tag on the fly
For example
I will get one of the tag in xml is as below
<from>Test Test... (12 Replies)
Discussion started by: guddu_12
12 Replies
LEARN ABOUT DEBIAN
test::xml::simple
Test::XML::Simple(3pm) User Contributed Perl Documentation Test::XML::Simple(3pm)NAME
Test::XML::Simple - easy testing for XML
SYNOPSIS
use Test::XML::Simple tests=>5;
xml_valid $xml, "Is valid XML";
xml_node $xml, "/xpath/expression", "specified xpath node is present";
xml_is, $xml, '/xpath/expr', "expected value", "specified text present";
xml_like, $xml, '/xpath/expr', qr/expected/, "regex text present";
xml_is_deeply, $xml, '/xpath/expr', $xml2, "structure and contents match";
# Not yet implemented:
# xml_like_deeply would be nice too...
DESCRIPTION
"Test::XML::Simple" is a very basic class for testing XML. It uses the XPath syntax to locate nodes within the XML. You can also check all
or part of the structure vs. an XML fragment.
TEST ROUTINES
xml_valid $xml, 'test description'
Pass an XML file or fragment to this test; it succeeds if the XML (fragment) is valid.
xml_node $xml, $xpath, 'test description'
Checks the supplied XML to see if the node described by the supplied XPath expression is present. Test fails if it is not present.
xml_is_long $xml, $xpath, $value, 'test description'
Finds the node corresponding to the supplied XPath expression and compares it to the supplied value. Succeeds if the two values match.
Uses Test::More's "is" function to do the comparison.
xml_is $xml, $xpath, $value, 'test description'
Finds the node corresponding to the supplied XPath expression and compares it to the supplied value. Succeeds if the two values match.
Uses Test::LongString's "is_string" function to do the test.
xml_like_long $xml, $xpath, $regex, 'test description'
Find the XML corresponding to the the XPath expression and check it against the supplied regular expression. Succeeds if they match. Uses
Test::More's "like" function to do the comparison.
xml_like $xml, $xpath, $regex, 'test description'
Find the XML corresponding to the the XPath expression and check it against the supplied regular expression. Succeeds if they match. Uses
Test::LongString's "like_string" function to do the test.
xml_is_deeply_long $xml, $xpath, $xml2, 'test description'
Find the piece of XML corresponding to the XPath expression, and compare its structure and contents to the second XML (fragment) supplied.
Succeeds if they match in structure and content. Uses Test::More's "is" function to do the comparison.
xml_is_deeply $xml, $xpath, $xml2, 'test description'
Find the piece of XML corresponding to the XPath expression, and compare its structure and contents to the second XML (fragment) supplied.
Succeeds if they match in structure and content. Uses Test::LongString's "is_string" function to do the test.
AUTHOR
Joe McMahon, <mcmahon@cpan.org>
LICENSE
Copyright (c) 2005 by Yahoo! and Joe McMahon
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.6.1 or,
at your option, any later version of Perl 5 you may have available.
SEE ALSO
XML::XPath, Test::More, Test::Builder.
perl v5.14.2 2012-06-05 Test::XML::Simple(3pm)