D
Deepan Perl XML Parser
Hi all,
I am having a file like below:
<?xml version="1.0" encoding="UTF-8"?>
<log xmlns="http://www.httpwatch.com/xml/log/5.1">
<entry method="GET" URL="http://www.google.com/sa/frame_main.cgi">
..
..
..
..
-------some text-------------
..
..
..
</entry>
<entry method="GET" URL="http://www.toogle.com/framer/main.cgi">
..
..
..
..
-------some text-------------
..
..
..
</entry>
<entry method="GET" URL="http://www.google.com/sa/frame_main.html">
..
..
..
..
-------some text-------------
..
..
..
</entry>
<page id="page_0" title="Sustaining Portal" dynamic="true"
unknown="false">
<started>00:00:00.000</started>
<startedDateTime>2008-03-25T09:52:12.791</startedDateTime>
</page>
<page id="page_1" title="Sustaining Portal" dynamic="true"
unknown="false">
<started>00:00:08.455</started>
<startedDateTime>2008-03-25T09:52:21.246</startedDateTime>
</page>
<page id="page_2" title="Sustaining Portal" dynamic="true"
unknown="false">
<started>00:00:20.296</started>
<startedDateTime>2008-03-25T09:52:33.087</startedDateTime>
</page>
<page id="page_3" title="Sustaining Portal" dynamic="true"
unknown="false">
<started>00:00:29.848</started>
<startedDateTime>2008-03-25T09:52:42.639</startedDateTime>
</page>
</log>
----------------------------------------------------------------------------------
Now how to get all those <entry ....> tags into an array? I mean
getting
<entry method="GET" URL="http://www.google.com/sa/
frame_main.cgi">
<entry method="GET" URL="http://www.toogle.com/framer/
main.cgi">
<entry method="GET" URL="http://www.google.com/sa/
frame_main.html">
into some array.
Thanks,
Deepan
I am having a file like below:
<?xml version="1.0" encoding="UTF-8"?>
<log xmlns="http://www.httpwatch.com/xml/log/5.1">
<entry method="GET" URL="http://www.google.com/sa/frame_main.cgi">
..
..
..
..
-------some text-------------
..
..
..
</entry>
<entry method="GET" URL="http://www.toogle.com/framer/main.cgi">
..
..
..
..
-------some text-------------
..
..
..
</entry>
<entry method="GET" URL="http://www.google.com/sa/frame_main.html">
..
..
..
..
-------some text-------------
..
..
..
</entry>
<page id="page_0" title="Sustaining Portal" dynamic="true"
unknown="false">
<started>00:00:00.000</started>
<startedDateTime>2008-03-25T09:52:12.791</startedDateTime>
</page>
<page id="page_1" title="Sustaining Portal" dynamic="true"
unknown="false">
<started>00:00:08.455</started>
<startedDateTime>2008-03-25T09:52:21.246</startedDateTime>
</page>
<page id="page_2" title="Sustaining Portal" dynamic="true"
unknown="false">
<started>00:00:20.296</started>
<startedDateTime>2008-03-25T09:52:33.087</startedDateTime>
</page>
<page id="page_3" title="Sustaining Portal" dynamic="true"
unknown="false">
<started>00:00:29.848</started>
<startedDateTime>2008-03-25T09:52:42.639</startedDateTime>
</page>
</log>
----------------------------------------------------------------------------------
Now how to get all those <entry ....> tags into an array? I mean
getting
<entry method="GET" URL="http://www.google.com/sa/
frame_main.cgi">
<entry method="GET" URL="http://www.toogle.com/framer/
main.cgi">
<entry method="GET" URL="http://www.google.com/sa/
frame_main.html">
into some array.
Thanks,
Deepan