Nothing happens on printing XML node contents
01:04 10 Apr 2014

I have been trying to find the node and print the text content, but when I tried to print, nothing happens.

This is my XML:


        
            
                
                    
                        
                            CHAPTER
                            II
                        
                        [EMPLOYEE’S] COMPENSATION
                    
                
                
                    
                        
                            
                                
                                    
                                        SECTION
                                        4
                                    
                                    
                                        <refpt type="ext" id="EMPCOM_ACT_00004">Amount of compensation.</refpt>
                                    
                                
                            
                            
                                
                                    
                                        
                                            
                                                
  • 1

    follows, namely:—

  • (a)

    Where death results from the injury an amount equal to 2[fifty per cent.] of the monthly wage of the deceased 3[employee] multiple by the relevant factor;

    or

    an amount of 4[one lakh and twenty thouand rupees], whichever is more;

  • (b)

    Where permanent total disablement results from the injury an amount equal to 2[sixty per cent.] of the monthly wages of the injured 3[employee] multiplied by the relevant factor,

    or

    an amount of 5[one lakh and forty thousand rupees], whichever is more:

    6[Provided that the Central Government may, by notification in the Official Gazette, from time to time, enhance the amount of compensation mentioned in clauses (a) and (b).]

    Explanation I.—For the purposes of clause (a) and clause (b), “relevant factor”,

    in relation to a 3[employee] means the factor specified in the second column of Schedule IV against the entry in the first column of that Schedule specifying the number of years which are the same as the completed years of the age of the 3[employee] on his last birthday immediately preceding the date on which the compensation fell due.

    7[* * *]

  • (c)

    Where permanent partial disablement results from the injury (i) in the case of an injury specified in Part injury, and

  • (ii)

    in the case of an injury not specified in Schedule I, such percentage of the compensation payable in the case of permanent total disablement as is proportionate to the loss of earning capacity (as assessed by the qualified medical practitioner) permanently caused by the injury.

    Explanation I.—Where more injuries than one are caused by the same accident, the amount of compensation payable under this head shall be aggregated but not so in any case as to exceed the amount which would have been payable if permanent total disablement had resulted from the injuries.

    Explanation II.—In assessing the loss of earning capacity for the purposes of sub-clause (ii), the qualified medical practitioner shall have due regard to the percentages of loss of earning capacity in relation to different injuries specified in Schedule I;

  • (d)

    Where temporary disablement, whether total or partial, results from the injury a half-monthly payment of the um equivalent to twenty-five per cent. of monthly wages of the 8[employee], to be paid in accordance with the provisions of sub-section (2).

  • 9[(1-A)

    Notwithstanding anything contained in sub-section (1), while fixing the amount of compensation payable to a 8[employee] in respect of an accident occurred outside India, the Commissioner shall take into account the amount of compensation, if any, awarded to such 8[employee] in accordance with the law of the country in which the accident occurred and shall reduce the amount fixed by him by the amount of compensation awarded to the 8[employee] in accordance with the law of that country.]

  • 10[(1-B)

    The Central Government may, by notification in the Official Gazette, specify, for the purposes of sub-section (1), such monthly wages in relation to an employee as it may consider necessary.]

  • (2)

    The half-monthly payment referred to in clause (d) of sub-section (1) shall be payable on the sixteenth day—

  • (i)

    from the date of disablement where such disablement lasts for a period of twenty-eight days or more, or

  • (ii)

    after the expiry of a waiting period of three days from the date of disablement where such disablement lasts for a period of less than twenty-eight days; and thereafter half-monthly during the disablement or during a period of five years, whichever period is shorter:

    Provided that—

  • (a)

    there shall be deducted from any lump sum or half-monthly payments to which the 11[employee] is entitled the amount of any payment or allowance which the 11[employee] has received from the employer by way of compensation during the period of disablement prior to the receipt of such lump sum or of the first half-monthly payment, as the case may be; and

  • (b)

    no half-monthly payment shall in any case exceed the amount, if any, by which half the amount of the monthly wages of the 11[employee] before the accident exceeds half the amount of such wages which he is earning after the accident.

    Explanation.—Any payment or allowance which the 11[employee] has received from the employer towards his medical treatment shall not be deemed to be a payment or allowance received by him by way of compensation within the meaning of clause (a) of the proviso.

  • 12[(2-A)

    The employee shall be reimbursed the actual medical expenditure incurred by him for treatment of injuries caused during the course of employment.]

  • (3)

    half-month.]

  • 13[(4)

    If the injury of the 11[employee] results 14[not less than five thousand the same to the eldest surviving dependant of the 11[employee] towards the expenditure of the funeral of such 11[employee] or where the 11[employee] did not have a dependant or was not living with his dependant at the time of his death to the person who actually incurred such expenditure:]

    15[Provided that the Central Government may, by notification in the Official Gazette, from time to time, enhance the amount specified in this sub-section.]

  • <emph typestyle="bf">COMMENTS</emph>

    This is my code:

    use strict;
    use warnings;
    
    use XML::LibXML;
    
    my $filename = "data1.xml";
    
    my $parser = XML::LibXML->new();
    my $xmldoc = $parser->parse_file($filename);
    
    my $t = $xmldoc->getDocumentElement;
    
    for my $sample ( $t->findnodes("/l/li/lilabel") ) {
        print $sample->textContent(),"\n";
    
    }
    

    I'm looking for text inside this tag: knldk

    xml perl