Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Transformation for HTML

Former Member
0 Kudos

Hi Gurus,

I am unzipping and reading an excel file from presentation server. The File is getting converted to XSTRING format while reading. When I am trying to convert from xstring to tet; it is getting convert to HTML in internal table.

Now how can I read my data from this ? I further need to pass fields into custom table.

If transformation is required , then please suggest on how to write a transformation for excel.

If any other solution is possible then please suggest.

8 REPLIES 8

Sandra_Rossi
Active Contributor
0 Kudos

that's not HTML, that's XML from an XLSX format. You should search the forum for classes to decode XLSX (CL_XLSX_DOCUMENT, tool xlsx2abap) . No need to unzip, there are classes to work on the XLSX file directly.

0 Kudos

Hi Sandra,

The body of the content starts with HTML tags somehow.

0 Kudos

Hi Sandra  ,

Thanks for the reply !

However I don't think its a simple xml as Html tags are present and tr/td and th tags are also there. I tried using the class : CL_XML_DOCUMENT , method PARSE_TABLE to parse the data but I got sy-subrc as 1 in return.

0 Kudos

oh very sorry, you're right, that's the old excel format! (XML 2003 for Excel, alias XMLSS), so that's XML with HTML inside XML comments (<!-- ... --> which are the same marks as HTML comments by the way ).

(the unzip mention at the beginning of your question made me think it was part of the excel file, and I didn't realize that the screen capture was "of course" XMLSS)

I remember I had created a tool with regular expressions to parse an XML 2003 for Word (same kind of format), and it was not so easy. If I remember well, I had issues with the XML where almost everything was XML compliant except one thing (somewhere, I don't remember)...

I advise you to either look for an existing ABAP tool for XMLSS (I don't know one), or ask people or machine to send a supported Excel format. Don't try to support several formats, that'll be a mess.

0 Kudos

Hi Sandra,

I have checked with people but it seems that this will be the only excel format that I will be getting.

Will writing a transformation be advisable ?

I am attaching the complete internal table data .

Also , I have never worked on any transformations before ; so let me know if u have any document to guide me through.

PFA the file. Excuse the filename  

0 Kudos

Thanks! (don't need excuse ) You should have posted the file first - it's not XMLSS but an EXCEL saved in HTML format, that's rare!

So a transformation can be used, but only after you convert the HTML into XML (AKA "XHTML", i.e. the HTML elements without an ending are to be ended, as for META, BR, etc.)

For help about the transformations (by the way choose ST, not XSLT, for a much better performance), simpy post a new question again

0 Kudos

Hi Sandra,

Can u suggest some method or way to convert HTML to XML  ??

I have never worked with both of these  ; so facing issues

0 Kudos

search that : html xhtml converter