[xml] Run-time error during XML parse



Hello everyone,
    I am a newbie to LibXML. As part of my project, I need to be able to parse an XML document and retrieve the attribute values of a particular node.
 
I used code from John Fleck's Libxml tutorial and tried to parse this document:
 
<?xml version="1.0"?>
<COMPOSITE-STREAM>
        <ENTITY  number="1      " set_number= "0      " timestamp= "33664656611727    " type="Histogram"/>
                <HISTOGRAMGROUP name="HIST_TIMER_FN" numhistograms="(1)"/>
                        <HISTOGRAM name="HIST_TIMER_FN-1"numevents="0" ymin="1000"ymax="10000"lowerbound="1000"upperbound="10000"numbuckets="12"range="900"/>
                                <UNDERFLOW value="0"/>
                                <BUCKETS number="1" lb="1000" ub="1899" value="0"/>
                                <BUCKETS number="2" lb="1900" ub="2799" value="0"/>
                                <BUCKETS number="3" lb="2800" ub="3699" value="0"/>
                                <BUCKETS number="4" lb="3700" ub="4599" value="0"/>
                                <BUCKETS number="5" lb="4600" ub="5499" value="0"/>
                                <BUCKETS number="6" lb="5500" ub="6399" value="0"/>
                                <BUCKETS number="7" lb="6400" ub="7299" value="0"/>
                                <BUCKETS number="8" lb="7300" ub="8199" value="0"/>
                                <BUCKETS number="9" lb="8200" ub="9099" value="0"/>
                                <BUCKETS number="10" lb="9100" ub="9999" value="0"/>
                                <OVERFLOW value="0"/>
        <ENTITY  number="3      " set_number= "0      " timestamp= "33664656955194    " type="Object"/>                 <OBJECT name="event_stats" handled="0" late="0" dropped="0" invalid="0" wdog="0" wbaddog1="0" wbaddog2="0"wbaddog3="0"/>
        <ENTITY  number="5      " set_number= "0      " timestamp= "33664657020478    " type="Counter"/>
                <COUNTER name="COUNTER_GOT_A_JIFFIE" total="7360" timestamp="33664656951682" />        <ENTITY  number="113    " set_number= "0      " timestamp= "33666149792172    " type="Event"/>
                <EVENT name="EVENT_TIMER_INTERRUPT"/>
</COMPOSITE-STREAM>
 
                         The problem is that when I tried to search for the node "BUCKETS", the name returned for the 'current' node was NULL ( (xmlChar *) 0x1 <Address 0x1 out of bounds>). I am using a UTF-8 encoded document (converted original document into the above document using iconv). Please let me know why the parse is not working as it should (current node name is NULL rather than the correct name of the node).
 
Thanks,
Sriram

.


Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]