The issue will be determining what is a valid XML tag and what is data that appears between "<" and ">". Is it always numeric? Are there negative numbers? Character strings? With or without spaces?
But making a guess, should the results be:
This was done with:
or with:
This User Gave Thanks to derekludwig For This Post:
Sorry to trouble you guys again.....but i encounter this problem:
My textfile contains this:
2006-01-12 01:12:08,290 INFO - The XML message **************<PM_ARRIVAL xmlns:xsi=
"http://www.w3.org/2001/XMLSchemainstance"><system_c>GMS</system_c><trans_c>ARLC</trans_c></<PM_ARRIVAL>
2006-01-12... (8 Replies)
Hi,
I have an XML file with following structure. Between following tags I have pipedelimited records with newline characters (Data1|1|2|3)
<!]>
I need to read the data between above tags so that my output is a flat file with pipedelimited records.
<BOS>
<Header>
<TTC>ABC</TTC> ... (9 Replies)
We have 2 XML file 1. ORIGINAL.xml file and 2. ATTRIBUTE.xml files, In the ORIGINAL.xml we need some modification as <resourceCode>431048</resourceCode>under <item type="Manufactured"> tag - we need to grab the 431048 value from tag and pass it to database table in unix shell script to find the... (0 Replies)
Hi All,
Find the following code:
<Universal>D38x82j1JJ
</Universal>
I want to retrieve the value of <Universal> tag as below:
Please help me. (3 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)
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)
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 want to basically do the below thing. Suppose there is a tag called object1. I want to display an output for all similar tag values under heading of Object 1 and the count of the xmls. Please help
File:
<xml><object1>house</object1><object2>child</object2>... (9 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 REDHAT
xml::filter::saxt
XML::Filter::SAXT(3) User Contributed Perl Documentation XML::Filter::SAXT(3)NAME
XML::Filter::SAXT - Replicates SAX events to several SAX event handlers
SYNOPSIS
$saxt = new XML::Filter::SAXT ( { Handler => $out1 },
{ DocumentHandler => $out2 },
{ DTDHandler => $out3,
Handler => $out4
}
);
$perlsax = new XML::Parser::PerlSAX ( Handler => $saxt );
$perlsax->parse ( [OPTIONS] );
DESCRIPTION
SAXT is like the Unix 'tee' command in that it multiplexes the input stream to several output streams. In this case, the input stream is a
PerlSAX event producer (like XML::Parser::PerlSAX) and the output streams are PerlSAX handlers or filters.
The SAXT constructor takes a list of hash references. Each hash specifies an output handler. The hash keys can be: DocumentHandler, DTDHan-
dler, EntityResolver or Handler, where Handler is a combination of the previous three and acts as the default handler. E.g. if Documen-
tHandler is not specified, it will try to use Handler.
EXAMPLE
In this example we use XML::Parser::PerlSAX to parse an XML file and to invoke the PerlSAX callbacks of our SAXT object. The SAXT object
then forwards the callbacks to XML::Checker, which will 'die' if it encounters an error, and to XML::Hqandler::BuildDOM, which will store
the XML in an XML::DOM::Document.
use XML::Parser::PerlSAX;
use XML::Filter::SAXT;
use XML::Handler::BuildDOM;
use XML::Checker;
my $checker = new XML::Checker;
my $builder = new XML::Handler::BuildDOM (KeepCDATA => 1);
my $tee = new XML::Filter::SAXT ( { Handler => $checker },
{ Handler => $builder } );
my $parser = new XML::Parser::PerlSAX (Handler => $tee);
eval
{
# This is how you set the error handler for XML::Checker
local $XML::Checker::FAIL = &my_fail;
my $dom_document = $parser->parsefile ("file.xml");
... your code here ...
};
if ($@)
{
# Either XML::Parser::PerlSAX threw an exception (bad XML)
# or XML::Checker found an error and my_fail died.
... your error handling code here ...
}
# XML::Checker error handler
sub my_fail
{
my $code = shift;
die XML::Checker::error_string ($code, @_)
if $code < 200; # warnings and info messages are >= 200
}
CAVEATS
This is still alpha software. Package names and interfaces are subject to change.
AUTHOR
Send bug reports, hints, tips, suggestions to Enno Derksen at <enno@att.com>.
perl v5.8.0 2000-02-11 XML::Filter::SAXT(3)