user1371033
user1371033

Reputation: 353

Converting HTML table into XML

i have an application which generates test case results in the form of HTML table. I need to convert this html table data into JUnit XML format for some other usage.

How can I parse each entry in of a table. I have browsed over internet, people are commenting other posts to conver html to xhtml which is xml equivalent but this doesn't suffice my requirement. I want the xml to be based on Junit xsd schema

Upvotes: 2

Views: 1173

Answers (1)

Alohci
Alohci

Reputation: 82986

You need a two step process. Use an HTML parser to create a DOM. There's lots to choose from in Java

When you've parsed the HTML and got a DOM, you can transform it into the XML form you want, either by hand code, or by using a transformation language like XSLT. Xalan is typically the library you want for performing XSLT transforms in Java.

Upvotes: 2

Related Questions