Sponsored Content
Top Forums Shell Programming and Scripting Grab XML attributes from file with bash script Post 303045637 by RudiC on Sunday 5th of April 2020 09:05:23 AM
Old 04-05-2020
Any attempts / ideas / thoughts from your side?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to remove xml namespace from xml file using shell script?

I have an xml file: <AutoData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Table1> <Data1 10 </Data1> <Data2 20 </Data2> <Data3 40 </Data3> <Table1> </AutoData> and I have to remove the portion xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" only. I tried using sed... (10 Replies)
Discussion started by: Gary1978
10 Replies

2. Windows & DOS: Issues & Discussions

DOS script to grab the first file in a dir and rename it

:confused: Hello, Is there any way to use the dir command / some DOS Script to select only first file of similar pattern of files in a direcotory and rename it for example, one directory has 5 files abc_1005.txt abc_5256.txt abc_2001.txt abc_2003.txt abc_3006.txt by use script I would... (2 Replies)
Discussion started by: raghav525
2 Replies

3. Shell Programming and Scripting

reading xml attributes with shell script

Hi, Iam new to shell scripting.I have below urgent requirement I want to read attributes (transaction,documentmode) in xml tag with shell scripting and create a filename with these attribues Xml : <PURCHASE_10 partner="food" version="1.50" timestamp="2009-03-10T09:56:55"... (3 Replies)
Discussion started by: swetha123
3 Replies

4. Shell Programming and Scripting

Need to Parse XML from bash script

I am completely new to bash scripting and now need to write a bash script that would parse a XML file and take out values from specific tags. I tried using xsltproc, xml_grep commands. But the issue is that the XML i am trying to parse is not UTF 8. so those commands are unable to parse my XML's... (4 Replies)
Discussion started by: shivashankar.g
4 Replies

5. Shell Programming and Scripting

Rewriting file paths in XML file within bash script

Hi guys, I'm working on a large set of scripts to move files around several servers and manipulate them for our staff. Basically we're shooting things, the videos hit a server and then need organised due to the language they've been shot in. Our XML (designed for Apple's Final Cut Pro) is right... (6 Replies)
Discussion started by: omfgbunnies
6 Replies

6. Shell Programming and Scripting

bash extract all occurences delimited from <name> and </name> tags from an xml file

I need to extract all text delimited from <name> and </name> tags from an xml file, but not only first occurence. I need to extract all occurences. I've tried with this command: awk -F"<name>|</name>" 'NF>2{print $2}' but it give only first occurence. How can i modify it? (18 Replies)
Discussion started by: ingalex
18 Replies

7. Shell Programming and Scripting

XML- Sed || Awk Bash script... Help!

Hi ! I'm working into my first bash script to make some xml modification and it's going to make me crazy lol .. so I decide to try into this forum to take some ideas from people that really know about this! This is my situation I've and xml file with a lots of positional values with another tags... (9 Replies)
Discussion started by: juampal
9 Replies

8. Shell Programming and Scripting

How to grab data from xml block?

I tried searching the forums, but couldn't find anything relevant to my question. I have an xml file like the following: <topLevel numberBlock="BLOCK1"> <item="content1" title="Content 1"> <RefPath="path/to/file1.txt /> </item> <item"content2" title="Content 2" >... (4 Replies)
Discussion started by: jl487
4 Replies

9. Shell Programming and Scripting

BASH script to parse XML and generate CSV

Hi All, Hope all you are doing good! Need your help. I have an XML file which needs to be converted CSV file. I am not an expert of awk/sed so your help is highly appreciated!! XML file looks like this: <l:event dateTime="2013-03-13 07:15:54.713" layerName="OSB" processName="ABC"... (2 Replies)
Discussion started by: bhaskar_m
2 Replies

10. UNIX for Beginners Questions & Answers

How to insert subnode in xml file using xmlstarlet or any other bash command?

I have multiple xml files where i want to update a subnode if the subnode project points to different project or insert a subnode if it doesn't exist using a xmlstarlet or any other command that can be used in a bash script. I have been able to update the subnode project if it doesn't point to... (1 Reply)
Discussion started by: Sekhar419
1 Replies
XML::Atom::Entry(3pm)					User Contributed Perl Documentation				     XML::Atom::Entry(3pm)

NAME
XML::Atom::Entry - Atom entry SYNOPSIS
use XML::Atom::Entry; my $entry = XML::Atom::Entry->new; $entry->title('My Post'); $entry->content('The content of my post.'); my $xml = $entry->as_xml; my $dc = XML::Atom::Namespace->new(dc => 'http://purl.org/dc/elements/1.1/'); $entry->set($dc, 'subject', 'Food & Drink'); USAGE
XML::Atom::Entry->new([ $stream ]) Creates a new entry object, and if $stream is supplied, fills it with the data specified by $stream. Automatically handles autodiscovery if $stream is a URI (see below). Returns the new XML::Atom::Entry object. On failure, returns "undef". $stream can be any one of the following: o Reference to a scalar This is treated as the XML body of the entry. o Scalar This is treated as the name of a file containing the entry XML. o Filehandle This is treated as an open filehandle from which the entry XML can be read. $entry->content([ $content ]) Returns the content of the entry. If $content is given, sets the content of the entry. Automatically handles all necessary escaping. $entry->author([ $author ]) Returns an XML::Atom::Person object representing the author of the entry, or "undef" if there is no author information present. If $author is supplied, it should be an XML::Atom::Person object representing the author. For example: my $author = XML::Atom::Person->new; $author->name('Foo Bar'); $author->email('foo@bar.com'); $entry->author($author); $entry->link If called in scalar context, returns an XML::Atom::Link object corresponding to the first <link> tag found in the entry. If called in list context, returns a list of XML::Atom::Link objects corresponding to all of the <link> tags found in the entry. $entry->add_link($link) Adds the link $link, which must be an XML::Atom::Link object, to the entry as a new <link> tag. For example: my $link = XML::Atom::Link->new; $link->type('text/html'); $link->rel('alternate'); $link->href('http://www.example.com/2003/12/post.html'); $entry->add_link($link); $entry->get($ns, $element) Given an XML::Atom::Namespace element $ns and an element name $element, retrieves the value for the element in that namespace. This is useful for retrieving the value of elements not in the main Atom namespace, like categories. For example: my $dc = XML::Atom::Namespace->new(dc => 'http://purl.org/dc/elements/1.1/'); my $subj = $entry->get($dc, 'subject'); $entry->getlist($ns, $element) Just like $entry->get, but if there are multiple instances of the element $element in the namespace $ns, returns all of them. get will return only the first. AUTHOR &; COPYRIGHT Please see the XML::Atom manpage for author, copyright, and license information. perl v5.12.4 2009-04-24 XML::Atom::Entry(3pm)
All times are GMT -4. The time now is 03:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy