cancel
Showing results for 
Search instead for 
Did you mean: 

How to extract data from this namespace

Former Member
0 Kudos

Hi all,

Anyone knows how to extract the value ABC from the XML below namespace ?

HELP !!!!

<?xml version="1.0" encoding="UTF-8" ?>

<ns0:CompanyCode xmlns:ns0="http://xidevt.sec.abc.net/common">ABC</ns0:CompanyCode>

Thanks in Advance

Accepted Solutions (0)

Answers (5)

Answers (5)

henrique_pinto
Active Contributor
0 Kudos

Dude,

that message is received by XI?

Just create a XSD that defines this XML (that should be very easy), import it as an external definition and define necessary message interfaces and mappings for your scenario.

Regards,

Henrique.

Former Member
0 Kudos

Hi all,

I need to extract the value ABC from the below using ABAP mapping. Anyone knows how to do it with ABAP MAPPING ?

<?xml version="1.0" encoding="UTF-8" ?>

<ns0:CompanyCode xmlns:ns0="http://xidevt.sec.abc.net/common">ABC</ns0:CompanyCode>

udo_martens
Active Contributor
0 Kudos

Hi Good Life,

Aaah, thank you for that information! Did you forget something else to tell us or can we now start with solving your problems?

Regards,

Udo

udo_martens
Active Contributor
0 Kudos

Hi Good Life,

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383">How to Use ABAP-Mapping in XI 3.0.pdf</a>

Regards,

Udo

Former Member
0 Kudos

Hi,

I am trying to use this ABAP command to extract the value ABC from the below. It does not seems to retrieve it. Can anyone tell me what is wrong with it

<?xml version="1.0" encoding="UTF-8" ?>

<ns0:CompanyCode xmlns:ns0="http://xidevt.sec.abc.net/common">ABC</ns0:CompanyCode>

My ABAP code is as follows.

a_ncoll1 = a_idocument->get_elements_by_tag_name_ns( name = 'CompanyCode' ).

a_node1 = a_ncoll1->get_item( 0 ).

elmt_value = a_node1->get_value( ).

udo_martens
Active Contributor
0 Kudos

Hi,

first: this is <b>well formed</b>. Of course it is not valid, we dont have a DTD or a schema. Well defined doesnt exist in XML world.

You can extract with mappings like Java, ABAP, graf mapping or XSL.

Here one example for XSL:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://xidevt.sec.abc.net/common">
	<xsl:template match="/">
		<extraction>
			<xsl:value-of select="ns0:CompanyCode"/>
		</extraction>
	</xsl:template>
</xsl:stylesheet>

Regards,

Udo

bhavesh_kantilal
Active Contributor
0 Kudos

Hi Udo,

I guess if one uses graphical Mapping in such a scenario, one can get some exception. But like u mentioned using a JAVA or ABAP mapping , one can extract the data out of the InputStream as needed.

Was thinking in terms of graphical mapping Java and ABAP can help in such cases I guess.

Regards,

Bhavesh

Former Member
0 Kudos

Hi,

<i><?xml version="1.0" encoding="UTF-8" ?>

<ns0:CompanyCode xmlns:ns0="http://xidevt.sec.abc.net/common">ABC</ns0:CompanyCode></i>

This is not a valid xml. ABC should have opening and closing tags other than the ns0 tag.

Regards,

Smitha.

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

<b>This is not a well defined XML structure</b>. Can you please elaborate on what actually you are trying.

Regards,

Bhavesh