cancel
Showing results for 
Search instead for 
Did you mean: 

HTML-->XML mapping.

Former Member
0 Kudos

Hi,experts

scenerio:

HTTP client<==>XI<==>non SAP system

This is a synchronous scenerio.the backend system receives HTTP request and returns response document with a form of HTML.So, in XI response mapping ,Do i need to transform the content type HTML into XML?and how should i do this?i have no experience about this,as far as i know,transforming XML into HTML needs a java mapping.what about HTML->XML?

please help .thanks.

Brand.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

better use Message Mapping... tat is good enough

Former Member
0 Kudos

Hi all

Thank you for replying.

But,as far as i know,the XSLT uses xpath to access XML,

so it can transform XML=>HTML,but can not transform HTML=>XML.Is it a misunderstanding?

Brand.

Former Member
0 Kudos

HI,

I think Using XPath you can address any node in an XML document. XSLT implements XPath expressions to select substructures of an XML document.

So with simple transformation its possible for HTML to XML with XSLT mapping.

Please refer 1st few pages of below link

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a89312f8-0b01-0010-86b3-fdd7178e...

Thanks

Swarup

Former Member
0 Kudos

> But,as far as i know,the XSLT uses xpath to access XML,

> so it can transform XML=>HTML,but can not transform HTML=>XML.Is it a misunderstanding?

Brand

I gave you a working example of converting HTML to XML in my earlier reply.....

Former Member
0 Kudos

Hi

It depends on what you want to do with the HTML.

But you can achieve the same using XSLT.

Here is a sample HTML very basic one...

<HTML>
<BODY>
<P align="center">
ABCD
</P> 
</BODY> 
</HTML>

Here is the XSLT which copies the XSLT as it is

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="*">
  <xsl:copy-of select="@*"/>
  <xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>

BR

Former Member
0 Kudos

Hi,

if it is complex structure go for XSLT or u can use xslt(abap) it is bit faster.

use XSLT_TOOL

Regards

Former Member
0 Kudos

Hi Brand,

To convert between HTML and XML, XSLT mapping is the best way.

If you need info on XSLT, please refer [this link|http://www.w3schools.com/xsl/default.asp].

Regards,

Riyaz