3
您好我有如下一个xml:Perl的XML :: SAX解析
<employees>
<employee>
<firstname>John</firstname>
<lastname>Doe</lastname>
<age>gg</age>
<department>Operations</department>
<amount Ccy="EUR">100</amount>
<joinDate> 12/12/2011 </joinDate>
</employee>
<employee>
<firstname>John1111</firstname>
<lastname>Doe1111</lastname>
<age>gg</age>
<department>Operations</department>
<amount Ccy="EUR">200</amount>
<joinDate> 12/13/2011 </joinDate>
</employee>
</employees>
我想这解析XML使用SAX ::。所以我重写了start_element和end_element和characters方法。我必须处理两个场景,我不知道如何处理。 1)如果joinDate为null,则将joinDate作为sysdate。 2)总结金额并获得一个值作为totalAmount。如何在perl中使用XML :: SAX模块来做到这一点。
抛出一些光我需要重写的方法来做到这一点,一小段代码将帮助。
感谢, SRIKANTH
感谢flesk。你的帖子对我总是有帮助的。 – user1019072 2012-01-11 20:45:48