My apologies if my original example wasn't very clear. Here's some sample data pulled from the XML files:
I'm looking specifically at the <Translation_Type> attribute, and deciding whether to comment the entire element or not based upon what that integer is.
In the sample above, I'd want the last element to be commented out in this format:
I'm familiar with PHP, but I've only done a little XML parsing with it before. I was under the impression that while I could parse through the XML and easily match/do logic on the Translation_Type values, I wouldn't be able to drop in those comments before and after the element? I'll certainly go back and look through my notes, but I was remembering using a multi-dimensional array type data structure to access the various elements, not actually editing the raw line-by-line file itself (that part being hidden via the PHP class, obviously you can add/drop/change the XML attributes).
Hi,
What is a good way to read elements of an xml file? i did try xmllint it doesnt provide a function to output values of a tree. In the below example when i specify from Family2 I need the name of the father then the output should be DAVE. Appreciate any help provided in this regards.
Many... (6 Replies)
Hi,
I would like to get rid of all comment in an xml file by grep or sed command:
The content seem like this:
<!-- ab cd
ef gh
ij kl -->
Anyone can help?
Thanks and Regards (3 Replies)
I am running a script remotely to do the following
1. Kill all processes by a user
2. Uninstall certain packages
3. FTP over a new file
4. Kill a ldap process that is not allowing my /devdsk/c0t0d0s7 slice to un-mount
5. Unmount /h
6. comment out the slice in vfstab
7. newfs the... (9 Replies)
I have around 25 hosts and each hosts has 4 instance of jboss and 4 different ip attached to it . I need to make some changes to the startup scripts. Any tips appreciated. I have total of 100 instances which bind to 100 different ip address based on instance name.
For example
File1
... (1 Reply)
hi,
i need my bash script to find regex in xml file.. and comment 2 lines before and after the line that contains regex.. can't use # needs to be <!-- at the beginning and --> and the end of the comment.
so eg..
first block
<filter>
<filter-name>MyRegEx</filter-name>
... (11 Replies)
Hi Friends
Im so confused with using 'for' loop in ksh. I have a xml like the following:
<serviceProvider>
<serviceProviderID>1</serviceProviderID>
<serviceProviderName>Balesh</serviceProviderName>
<serviceFeeAmount>30.00</serviceFeeAmount>
</serviceProvider>... (2 Replies)
Hello!
I'd like to modify custom values in a XML config file between comment tags using bash script.
<feature>
<keyboardshortcut>C-m</keyboardshortcut>
<option1>disabled</option2>
<option2>enabled</option2>
</feature>
<!-- bash script features START -->
<feature>
... (2 Replies)
Hi ,
I have an XML like this.
<Request>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<version>v44</version><messageId>7247308192</messageId><timeToLive>72000000000</timeToLive>
</Request>.
I want to extract on version and messageId.
As in my output... (13 Replies)
I am trying to comment out the crontab entries using sed.
I want to comment it out for a particular environment say '/mypath/scripts/'.
Using the full path as pattern, it is working. but using variable it is not working. i have tried double quotes too. but no luck!
$ crontab -l
... (3 Replies)
Hi,
I have a requirement to extract specific element value dynamically from XML message.
Here is the sample message:
<File>
<List>
<main>
<dir>doc/store834/archive</dir>
<count>5</count>
</main>
<main>
<dir>doc/store834/extract</dir>
<count>6</count>
</main>
<main> ... (3 Replies)
Discussion started by: renukeswar
3 Replies
LEARN ABOUT DEBIAN
graph::reader::xml
Graph::Reader::XML(3pm) User Contributed Perl Documentation Graph::Reader::XML(3pm)NAME
Graph::Reader::XML - class for reading a Graph instance from XML
SYNOPSIS
use Graph::Reader::XML;
use Graph;
$reader = Graph::Reader::XML->new();
$graph = $reader->read_graph('mygraph.xml');
DESCRIPTION
Graph::Reader::XML is a perl class used to read a directed graph stored as XML, and return an instance of the Graph class.
The XML format is designed to support the Graph classes: it can be used to represent a single graph with a collection of nodes, and edges
between those nodes. The graph, nodes, and edges can all have attributes specified,
Graph::Reader::XML is a subclass of Graph::Reader, which defines the generic interface for Graph reader classes.
METHODS
new()
Constructor - generate a new reader instance.
$reader = Graph::Reader::XML->new();
This doesn't take any arguments.
read_graph()
Read a graph from a file:
$graph = $reader->read_graph( $file );
The $file argument can be either a filename or a filehandle of a previously opened file.
KNOWN BUGS
Attribute values must be scalar. If they're not, well, you're on your own.
SEE ALSO
Graph::Reader
The base class for Graph::Reader::XML.
Graph::Writer::XML
Used to serialise a Graph instance as XML.
Graph
Jarkko Hietaniemi's classes for representing directed graphs.
AUTHOR
Neil Bowers <neil@bowers.com>
COPYRIGHT
Copyright (c) 2001-2012, Neil Bowers. All rights reserved. Copyright (c) 2001, Canon Research Centre Europe. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-02-14 Graph::Reader::XML(3pm)