freelanceprogrammers.org Forum Index » Perl

Parsing CDATA section using XML::DOM:Parser


View user's profile Post To page top
aswolff1971 Posted: Fri Jun 25, 2004 11:34 pm


Joined: 25 Jun 2004

Posts: 1
Parsing CDATA section using XML::DOM:Parser
Hello,

I am trying to write a script that can parse CDATA section of an xml
document. The element where the CDATA section lives is called
AttData and there are several of them I need to read thru.

I am using XML::DOM::Parser (But not sure if this module has the
ability to parse CDATA sections).

Below is what I have so far (my xml string is $res)

=====START CODE====
my $parser = new XML::DOM::Parser;
my $doc = $parser->parse($res);
my $nodes = $doc->GetElementsByTagName("AttName");
my $n = $nodes->getLength;
for (my $j = 0; $j < $n; $j++) {
my $node = $nodes->item($j);
I am stuck :(

======END CODE=====
Reply with quote
Send private message
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help