Re: How to parse XML content using lwp agent or XML Smart

2014-08-25 Thread angus
Hi Rob, I am sorry, I somehow missed your response until this evening and in the mean time have figured out lots of new ways to have this fail . Anyway, I looked at your sample and came up with the following updates and it works but I am interested to hear your input on how I can improve it. #

Re: How to parse XML content using lwp agent or XML Smart

2014-08-22 Thread Rob Dixon
On 22/08/2014 11:27, angus wrote: > Hi, > > Hi, > > I have some sample code that posts some XML content to an URL using > LWP agent and XML Smart. The response to this comes back as some > custom XML. I now need to try and parse the response and find the > REDIRECTURL value and redirect the

How to parse XML content using lwp agent or XML Smart

2014-08-22 Thread angus
Hi, Hi, I have some sample code that posts some XML content to an URL using LWP agent and XML Smart. The response to this comes back as some custom XML. I now need to try and parse the response and find the REDIRECTURL value and redirect the client to that destination. I am having issues p

Re: parse xml with invalid chars

2010-06-06 Thread Chas. Owens
On Sat, Jun 5, 2010 at 09:59, Dr.Ruud wrote: > Chas. Owens wrote: > >> my $xml = do { >>  open my $fh, "<", $filename >>  or die "could not open $filename: $!"; >>  local $/; >>  <$fh>; >> }; > > I would write that as > >  my $xml; >  {   open my $fh, "<", $filename >        or die "could not open

Re: parse xml with invalid chars

2010-06-06 Thread Dr.Ruud
Chas. Owens wrote: my $xml = do { open my $fh, "<", $filename or die "could not open $filename: $!"; local $/; <$fh>; }; I would write that as my $xml; { open my $fh, "<", $filename or die "could not open $filename: $!"; local $/; $xml= <$fh>; } because it pu

Re: parse xml with invalid chars

2010-06-05 Thread Roman Makurin
I think i found solution suitable for me. I would wrap all broken texts in CDATA sections, it works perfectly. Thanks for help On Fri, Jun 04, 2010 at 02:05:58PM -0400, Chas. Owens wrote: > On Fri, Jun 4, 2010 at 13:30, Roman Makurin wrote: > > I used mostly the same things, but without uri_(un)

Re: parse xml with invalid chars

2010-06-04 Thread Chas. Owens
On Fri, Jun 4, 2010 at 13:30, Roman Makurin wrote: > I used mostly the same things, but without uri_(un)escape it doesnt work. > If i clearly understant, in order to parse feed i need apply escape > methods to broken elements, am i right ? snip How you fix each section that is broken is dependent

Re: parse xml with invalid chars

2010-06-04 Thread Roman Makurin
i all > >> > > >> > Last time i have a big problem, i need parse xml files > >> > which have invalid xml chars outside of CDATA and xml > >> > parser hangs everytime on such files. Is there any way > >> > to parse such files ??? > >> sni

Re: parse xml with invalid chars

2010-06-04 Thread Chas. Owens
On Fri, Jun 4, 2010 at 12:23, Roman Makurin wrote: > Hi, here it is http://pastebin.org/307289 > > On Fri, Jun 04, 2010 at 12:06:24PM -0400, Chas. Owens wrote: >> On Fri, Jun 4, 2010 at 10:16, Roman Makurin wrote: >> > Hi all >> > >> > Last time i

Re: parse xml with invalid chars

2010-06-04 Thread Roman Makurin
Hi, here it is http://pastebin.org/307289 On Fri, Jun 04, 2010 at 12:06:24PM -0400, Chas. Owens wrote: > On Fri, Jun 4, 2010 at 10:16, Roman Makurin wrote: > > Hi all > > > > Last time i have a big problem, i need parse xml files > > which have invalid xml cha

Re: parse xml with invalid chars

2010-06-04 Thread Chas. Owens
On Fri, Jun 4, 2010 at 10:16, Roman Makurin wrote: > Hi all > > Last time i have a big problem, i need parse xml files > which have invalid xml chars outside of CDATA and xml > parser hangs everytime on such files. Is there any way > to parse such files ??? snip Can you give a

parse xml with invalid chars

2010-06-04 Thread Roman Makurin
Hi all Last time i have a big problem, i need parse xml files which have invalid xml chars outside of CDATA and xml parser hangs everytime on such files. Is there any way to parse such files ??? thanks -- If you think of MS-DOS as mono, and Windows as stereo, then Linux is Dolby Digital and

parse xml

2010-04-12 Thread vyomesh Kulkarni
hello I am trying to parse my xml file which looks like below. its a test case structure. each test case can have multiple actions. the code i could write to parse is below... i am new to perl. #!/usr/bin/perl use Net::Telnet; use Expect; use XML::Simple qw(:strict); use Data::Du

re parse xml to Franklin

2004-10-29 Thread E.Horn
Ok! So Franklin, how does your parser look like? Is this really the same homepage you parse? Where do you come from ;-) perhaps you sit in the room next door? joking...?! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: parse xml

2004-10-29 Thread Traeder, Philipp
On Friday 29 October 2004 10:44, E.Horn wrote: > geben Sie ein gtpprotein ein > ras > > "http://www.ncbi.nlm.nih.gov/entrez/query/DTD/egquery.dtd";> > > > > > > > ras > > > > > pubmed > PubMed > 27832 >

parse xml

2004-10-29 Thread E.Horn
geben Sie ein gtpprotein ein ras http://www.ncbi.nlm.nih.gov/entrez/query/DTD/egquery.dtd";> ras pubmed PubMed 27832 Ok pmc

Re: parse xml

2004-10-28 Thread Franklin
I have gotten it done. Thanks - Original Message - From: "Philipp Traeder" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 28, 2004 5:40 AM Subject: Re: parse xml Hi Franklin, please bottom post (write your answer below the quoted text) - it

Re: parse xml

2004-10-28 Thread Philipp Traeder
Hi Franklin, please bottom post (write your answer below the quoted text) - it's much easier to follow a thread this way. On Thursday 28 October 2004 02:11, Franklin wrote: > >> > print $ref->{'ResultItem'}->[0]{'MenuName'}; > I tried this one , but it seems not working:( > Not an ARRAY referen

Re: parse xml

2004-10-27 Thread Franklin
I tried this one , but it seems not working:( Not an ARRAY reference at test.pl line 8 - Original Message - From: "Philipp Traeder" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, October 25, 2004 4:36 PM Subject: Re: parse xml On Monday 25 October 2004

Re: parse xml

2004-10-25 Thread Philipp Traeder
On Monday 25 October 2004 16:49, Jenda Krynicky wrote: > From: "Traeder, Philipp" <[EMAIL PROTECTED]> > > > print $ref->{'ResultItem'}->[0]{'MenuName'}; > > I think it's better to either skip all the -> between subscriptions > or include them all: > > print $ref->{'ResultItem'}[0]{'MenuName'}

Re: parse xml

2004-10-25 Thread Jenda Krynicky
From: "Traeder, Philipp" <[EMAIL PROTECTED]> > print $ref->{'ResultItem'}->[0]{'MenuName'}; I think it's better to either skip all the -> between subscriptions or include them all: print $ref->{'ResultItem'}[0]{'MenuName'}; or print $ref->{'ResultItem'}->[0]->{'MenuName'}; It do

Re: parse xml

2004-10-25 Thread Traeder, Philipp
On Monday 25 October 2004 16:27, E.Horn wrote: > Hey! > How can i pars this xmlfile? > i just want to have the geo and the count out of > this... > [..] Hi, I can highly recommend XML::Simple - just use it like this: #!/usr/bin/perl -w use strict; use XML::Simple; use Data::Dumper; my $ref =

parse xml

2004-10-25 Thread E.Horn
Hey! How can i pars this xmlfile? i just want to have the geo and the count out of this... geo GEO Profiles 69408 Ok gds GEO DataSets 8

Re: Trying to parse XML file

2004-08-23 Thread Richard Jolly
On 23 Aug 2004, at 20:29, Kevin Old wrote: Hello everyone, I'm new to parsing XML files. I've got a somewhat working attempt, but keep getting errors when certain elements are undefined. Can't call method "as_text" on an undefined value at ./xmltreebuild.pl line 33. Believe the error message! Lin

RE: Trying to parse XML file

2004-08-23 Thread Thomas, Mark - BLS CTR
tractions a one-liner. You can do things like contains() and starts-with(), etc, and XPath 2.0 (currently a W3C working draft) will have regular expression support. Personally, I think XPath is a great way to parse XML, because they are simply strings. These can be externalized, so if the XML chang

RE: Trying to parse XML file

2004-08-23 Thread Thomas, Mark - BLS CTR
Your code loops around a 'product-announced' element, which doesn't exist in your file. Does that have something to do with it? Since you say you're new to XML parsing, perhaps you'd like to see an example of an alternate solution. The following is XML::LibXML code, and XML::Xpath code would be vi

Re: Trying to parse XML file

2004-08-23 Thread Kevin Old
On Mon, 23 Aug 2004 17:02:20 -0400, Thomas, Mark - BLS CTR <[EMAIL PROTECTED]> wrote: > Your code loops around a 'product-announced' element, which doesn't exist in > your file. Does that have something to do with it? > > Since you say you're new to XML parsing, perhaps you'd like to see an > exam

Trying to parse XML file

2004-08-23 Thread Kevin Old
Hello everyone, I'm new to parsing XML files. I've got a somewhat working attempt, but keep getting errors when certain elements are undefined. Can't call method "as_text" on an undefined value at ./xmltreebuild.pl line 33. Attached is the XML I'm trying to parse and xmltreebuild.pl. Any sugge

Re: Parse XML

2002-09-20 Thread david
here that can help you quickly find what you need in a XML file. one of those module is XML::Parser. you can use it like: #!/usr/bin/perl -w use strict; use XML::Parser; my $kw = 0; my $kws = ''; my $xml = new XML::Parser(Handlers => {Start => \&start, End => \&end,

Re: Parse XML

2002-09-20 Thread Jenda Krynicky
ng /m and /s but these don't seem to work. I have set > $/="", I don't know if this is impacting on my attempts. But > changing it does help either. It's better to use one of the modules available in CPAN than to try to parse XML yourself. If the XML file is not t

Parse XML

2002-09-20 Thread Dermot Paikkos
Hi, I am trying to parse the data out of am XML file. The file is below. Most of the data is easily grabbed but the keywords stretch over several newlines and there can anywhere between 0 and 20 entries. I have tried using /m and /s but these don't seem to work. I have set $/="", I don't know