Hi
I want to get the value between to XML tags as follows
<EAN>12345</EAN>
so i would want to return 12345. i have tried sed and awk but can't do it.
can anyone help? (9 Replies)
I want to search the below XML pattern in the XML files, but the XML files would be in a .GZ files,
<PRODID>LCTO84876</PRODID>
<PARTNUMBER>8872AC1</PARTNUMBER>
<WWPRODID>MODEL84876</WWPRODID>
<COUNTRY>US</COUNTRY>
<LANGUAGE>1</LANGUAGE>
What's the command/script to search it ? :confused: (2 Replies)
Greetings,
I have an XML : file.xml
<component>
<name>abcd</name>
<value>1234</value>
</component>
I am using sed to replace abcd with the desired value dynamically without knowing the actual value.
sed 's/<name>./]\{1,\}<\/name>/<name>ijkl<\/name>/' file.xml > newfile.xml
I... (6 Replies)
Hi,
I have a log file that I need to monitor as it's being written to, and I want to exclude certain strings from the output. At the moment I'm using ...
tail -f LogFileName_`date +%d`.log | egrep -v "First String To Exclude | 2nd string | 3rd string" ...which works OK - but now I need to... (1 Reply)
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 have a XML in which <Amt Ccy="EUR">3.1</Amt> tag repeats. This is under another tag <Main>. I need to sum all the values of <Amt Ccy=""> (Ccy may vary) coming under <Main> using awk and or sed command.
can some help?
Sample looks like below
<root>
<Main>
... (6 Replies)
Hi All
i need to replace the url1 inside <remote> tag in below xml in first instance and in the second instance with url2.
any help appreciated
<locations>
<hudson.scm.SubversionSCM_-ModuleLocation>
<remote>https://svn2015.com/svn/repos/internalshard</remote>
... (4 Replies)
Sorry for the long/weird title but I'm stuck on a problem I have. I have this XML file:
</member>
<member>
<name>TransactionID</name>
<value><string>123456789123456</string></value>
</member>
<member>
<name>Number</name>
... (9 Replies)
I have a simple xml file,need the output with the <value> tag and <result> tag
text.xml
<test-method status="FAIL" duration="45">
<value>
Id=C18
</value>
<result>
wrong paramter
</result>
</test-method>
<test-method status="FAIL" duration="45">
<value>
Id=C19
</value>
<result>
Data... (5 Replies)
Discussion started by: DevAakash
5 Replies
LEARN ABOUT DEBIAN
xml::generator::dom
DOM(3pm) User Contributed Perl Documentation DOM(3pm)NAME
XML::Generator::DOM - XML::Generator subclass for producing DOM trees instead of strings.
SYNOPSIS
use XML::Generator::DOM;
my $dg = XML::Generator::DOM->new();
my $doc = $dg->xml($dg->xmlcmnt("Test document."),
$dg->foo({'baz' => 'bam'}, 42));
print $doc->toString;
yields:
<?xml version="1.0" standalone="yes"?>
<!--Test document-->
<foo baz="bam">42</foo>
DESCRIPTION
XML::Generator::DOM subclasses XML::Generator in order to produce DOM trees instead of strings (see XML::Generator and XML::DOM). This
module is still experimental and its semantics might change.
Essentially, tag methods return XML::DOM::DocumentFragment objects, constructed either from a DOM document passed into the constructor or a
default document that XML::Generator::DOM will automatically construct.
Calling the xml() method will return this automatically constructed document and cause a fresh one to be constructed for future tag method
calls. If you passed in your own document, you may not call the xml() method.
Below, we just note the remaining differences in semantics between XML::Generator methods and XML::Generator::DOM methods.
CONSTRUCTOR
These configuration options are accepted but have no effect on the semantics of the returned object: escape, pretty, conformance and empty.
TAG METHODS
Subsequently, tag method semantics are somewhat different for this module compared to XML::Generator. The primary difference is that tag
method return XML::DOM::DocumentFragment objects. Namespace and attribute processing remains the same, but remaining arguments to tag
methods must either be text or other XML::DOM::DocumentFragment objects. No escape processing, syntax checking, or output control is done;
this is all left up to XML::DOM.
SPECIAL TAGS
All special tags are available by default with XML::Generator::DOM; you don't need to use 'conformance' => 'strict'.
xmlpi(@args)
Arguments will simply be concatenated and passed as the data to the XML::DOM::ProcessingInstruction object that is returned.
xmlcmnt
Escaping of '--' is done by XML::DOM::Comment, which replaces both hyphens with '-'. An XML::DOM::Comment object is returned.
xmldecl
Returns an XML::DOM::XMLDecl object. Respects 'version', 'encoding' and 'dtd' settings in the object.
xmldecl
Returns an XML::DOM::DocumentType object.
xmlcdata
Returns an XML::DOM::CDATASection object.
xml
As described above, xml() can only be used when dom_document was not set in the object. The automatically created document will have its
XML Declaration set and the arguments to xml() will be appended to it. Then a new DOM document is automatically generated and the old one
is returned. This is the only way to get a DOM document from this module.
perl v5.12.4 2004-03-23 DOM(3pm)