Removing a tag from an xml document

Hi,

Im trying to convert part of a HTML document to REXML and its throwing
it back at me due to the fact that the html document isnt valid XML due
to one closing tag which doesnt have an opener.

heres the xml:

        <td></td>

      </tr>
    </thead>


      <tbody>

        <tr class="odd-row ">
          <td class="data"><a 

href=“buildresults/henry-mobile-server”>henry-
mobile-server




          <td class="data"><input id="force_henry-mobile-server" 

type=“butto
n”
onclick=“callServer(‘http://etab-va:8000/i
nvoke?operation=build&objectname=CruiseControl+Project%3Aname%3Dhenry-mobile-ser
ver’, ‘henry-mobile-server’)”
value=“Build”/>

        </tr>

      </tbody>

        <tr class="even-row ">
          <td class="data"><a 

href=“buildresults/henry-mobile-server-nightly
-build”>henry-mobile-server-nightly-build




          <td class="data"><input 

id=“force_henry-mobile-server-nightly-buil
d” type=“button”
onclick=“callServer(‘http://etab-va:8000/i
nvoke?operation=build&objectname=CruiseControl+Project%3Aname%3Dhenry-mobile-ser
ver-nightly-build’, ‘henry-mobile-server-nightly-build’)”
value=“Build”/>

        </tr>

      </tbody>
      </table>

What i need to do is to strip out the final “” tag from the
file.

The html is being fethced using net/http and then that part of the page
is being extracted from the full page with the following line:

gathered_data = response.body[table_start_pos,height]

any ideas on how I should remove that tag?

Cheers,

Chris

Project Status (sinc e) Last failu re Last su ccessful Label ? (10:05) 09:31 build.19 ? (10:05)

Hello,

What i need to do is to strip out the final “” tag from the
file.

just do this:

input.sub(’’) {’’}

Cheers,
Peter

__
http://www.rubyrailways.com

Hi Peter,

Thanks for the reply.

I ended up using gsub as I had a number of those records present but its
pretty much the same.

Cheers,

Chris

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs