Loading ...
Sorry, an error occurred while loading the content.

How get cell count and match total column value

Expand Messages
  • Byomkesh
    Hi I am trying to column count and match in tgroup cols value in XML file (through perl). if column count and tgroup cols value is mismatch, its showing error.
    Message 1 of 1 , Mar 9, 2007
    • 0 Attachment
      Hi

      I am trying to column count and match in tgroup cols value in XML
      file (through perl). if column count and tgroup cols value is
      mismatch, its showing error. I have a huge xml file. thats why i was
      not added here. I want to catch if tgroup cols="3" colspace(column)
      should be 3. If colspace should be 4 then showing parse error.


      My xml
      --------------
      <tgroup cols="3">
      <colspec colnum="1" colname="col1"/>
      <colspec colnum="2" colname="col2"/>
      <colspec colnum="3" colname="col3"/>
      <tbody>

      My pl file
      ----------
      $tmp=0;
      print "Enter the filename: ";
      chomp($ram=<STDIN>);
      open(RED,"$ram.xml");
      open(MAD,">$ram.err");
      print "WAIT! CHECKING IS IN PROGRESS ..... .....\n";
      $cols=0;
      while(<RED>)
      {
      $cou++;
      if(/[.,:;!]<\/title>/)
      {
      print MAD "LINE No. $cou: Trailing punctuations found before
      </title>
      \n";
      }
      if(/[.,:;?!]<\/mono>/)

      {
      print MAD "LINE No. $cou: Trailing punctuations found before </mono>
      \n";

      }
      }
      close(RED);
      close(MAD);

      I am confused how define tgroup cols value and count in
      colspace(column) then it is not matching in tgroup cols value, should
      be showing error msg. Value is not constant. Because so many tables
      in XML files. All tables column is different. If table is 5 column,
      tgroup cols="5".

      Anyone some advice me.

      Byomokesh
    Your message has been successfully submitted and would be delivered to recipients shortly.