Using shell command need to parse multiple nested tag value of a XML file
I have this XML file -
Now, I need to first search for "<mm>LongTime</mm>", if found then I have to find for "Desti = Motion" value (which is inside <lkid>StartEle=ONE, Desti = Motion</lkid>) inside the multiple nested sub-tags ... and if that is also found then I finally have to get the value inside the TAG below, which is 12 (<kk>12</kk>).
Please help, using anything - AWK, SED, Grep, anything will do.
Thanks in advance.
Last edited by bartus11; 01-09-2014 at 08:39 AM..
Reason: Please use code tags.
I have an xml file with the structure:
<tag1>
<value1>xyx</value1>
<value2>123</value2>
</tag1>
<tag1>
<value1>568</value1>
<value2>zzzzz</value2>
</tag1>
where I want to parse each data pair in the this single file, so something like:
find first tag1 data pair... (1 Reply)
Hi all,
I have a file which i have to remove some line from it,
the lines that i have to remove from my file is as below:
</new_name></w"s" langue="Fr-fr" version="1.0" encoding="UTF-8" ?> <New_name>
and it is finding at the middle of my file,
is there any command line in linux to do it or do... (10 Replies)
Hi All,
I'm stuck with adding multiple lines(irrespective of line number) to a file before a particular xml tag. Please help me.
<A>testing_Location</A>
<value>LA</value>
<zone>US</zone>
<B>Region</B>
<value>Russia</value>
<zone>Washington</zone>
<C>Country</C>... (0 Replies)
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)
I have a xml file in where I need to parse only a particular tag and print the output in the shell script.
Here is the tag info in the xml file
<dp:file> This is dp file output </dp:file>
Output should be printed as
This is dp file output.
Please help.Thank you. (5 Replies)
Hi Guys
Here is my Input :
<?xml version="1.0" encoding="UTF-8"?>
<xn:MeContext id="01736">
<xn:VsDataContainer id="01736">
<xn:attributes>
<xn:vsDataType>vsDataMeContext</xn:vsDataType>
... (12 Replies)
Hi All,
Can someone tell me how can we create same xml tag lines based on the number of lines present in other file and replace the Name variable vaule present in other file.
basically I have this xml line
<typ:RequestKey NameType="RIC" Name="A1" Service="DDA"/>
and say I... (4 Replies)
Greetings all,
I have an XML file that is being generated from my application, here is a sample of the first tag (That I am trying to remove and display in a list..)
Example-
<tag one= "data" data="1234" updateTime="1300">
<tag one= "data1" data="1234" updateTime="1300">
<tag... (5 Replies)
Hi Forum.
I have an XML file with the following requirement to move the <AdditionalAccountHolders> tag and its content right after the <accountHolderName> tag within the same file but I'm not sure how to accomplish this through a Unix script.
Any feedback will be greatly appreciated.
... (19 Replies)
I want to write a one line script that outputs the result of multiple xml tags from a XML file. For example I have a XML file which has below XML tags in the file:
<EMAIL>***</EMAIL>
<CUSTOMER_ID>****</CUSTOMER_ID>
<BRANDID>***</BRANDID>
Now I want to grep the values of all these specified... (1 Reply)
Discussion started by: shubh752
1 Replies
LEARN ABOUT DEBIAN
template::alloy::velocity
Template::Alloy::Velocity(3pm) User Contributed Perl Documentation Template::Alloy::Velocity(3pm)NAME
Template::Alloy::Velocity - Velocity (VTL) role
DESCRIPTION
The Template::Alloy::Velocity role provides the syntax and the interface for the Velocity Templating Language (VTL). It also brings many
of the features from the various templating systems.
See the Template::Alloy documentation for configuration and other parameters.
The following documents have more information about the velocity language.
http://velocity.apache.org/engine/devel/vtl-reference-guide.html
http://www.javaworld.com/javaworld/jw-12-2001/jw-1228-velocity.html?page=4
TODO
Add language usage and samples.
ROLE METHODS
"parse_tree_velocity"
Used bh the parse_tree method when SYNTAX is set to 'velocity'.
"merge"
Similar to process_simple, but with syntax set to velocity.
UNSUPPORTED VELOCITY SPEC
o The magic Java Velocity property lookups don't exist. You must use the actual method name, Alloy will not try to guess it for you.
Java Velocity allows you to type $object.Attribute and Java Velocity will look for the Attribute, getAttribute, getattribute,
isAttribute methods. In Perl Alloy, you can call $object.can('Attribute') to introspect the object.
o Escaping of variables is consistent. The Java Velocity spec is not. The velocity spec says that "\$email" will return "\$email" if
email is not defined and it will return "foo" if email is equal to "foo". The slash behavior magically changes according to the spec.
In Alloy the "\$email" would be "$email" if email is not defined.
o You can set items to null (undefined) in Alloy. According to the Java Velocity reference-guide you have to configure Velocity to do
this. To get the other behavior, you would need to do "#if($questionable)#set($foo=$questionable)#end". The default Velocity spec way
provides no way for checking null return values.
o There currently isn't a "literal" directive. The VTL reference-guide doesn't mention #literal, but the user-guide does. In Alloy you
can use the following:
#get('#foreach($a in [1..3]) $a #end')
We will probably add the literal support - but it will still have to parse the document, so unless you are using compile_perl, you will
parse literal sections multiple times.
o There is no "$velocityCount" . Use "$loop.count" .
o In Alloy, excess whitespace outside of the directive matters. In the VTL user-guide it mentions that all excess whitespace is gobbled
up. Alloy supports the TT chomp operators. These operators are placed just inside the open and close parenthesis of directives as in
the following:
#set(~ $a = 1 ~)
o In Alloy, division using "/" is always floating point. If you want integer division, use "div". In Java Velocity, "/" division is
integer only if both numbers are integers.
o Perl doesn't support negative ranges. However, arrays do have the reverse method.
#foreach( $bar in [-2 .. 2].reverse ) $bar #end
o In Alloy arguments to macros are passed by value, not by name. This is easy to achieve with alloy - simply encase your arguments in
single quotes and then eval the argument inside the macro. The velocity people claim this feature as a jealously guarded feature. My
first template system "WrapEx" had the same feature. It happened as an accident. It represents lazy software architecture and is
difficult to optimize.
AUTHOR
Paul Seamons <paul at seamons dot com>
LICENSE
This module may be distributed under the same terms as Perl itself.
perl v5.10.1 2008-09-16 Template::Alloy::Velocity(3pm)