Skip to Content
0

Problem with Mixed Content XML in SAP PO 7.5

Feb 24, 2017 at 09:37 AM

91

avatar image

Hi All ,

In one of the requirement ,in integration with success factors employee central ,using SAP PO 7.5, I am facing issue with mixed content in my xsd ,It is like i am getting data as shown in highlighted text.

This is the XML mixed content which is not getting handled by the PO System.

I am not getting the values of the node which includes mixed content as shown

Here the value "test6" is not getting populated in the field "middle_name".

How can we handle this in PO 7.5?

sf2.jpg (56.8 kB)
sf1.jpg (66.4 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
PIYUSH SHARMA Jun 15, 2017 at 10:44 AM
1

I solved this problem by using Additional Parameter resultOptions with its value renderPreviousTags while doing the query through SFSF channel .

Share
10 |10000 characters needed characters left characters exceeded
Evgeniy Kolmakov Feb 24, 2017 at 12:11 PM
2

Hi Piyush!

For this test input:

<?xml version="1.0" encoding="UTF-8"?>
<MT_RootNode>
    <Element1>
        <SubElement1>Value1</SubElement1>
    </Element1>
    <Element2>Value2<SubElement2>Value3</SubElement2>
    </Element2>
</MT_RootNode>

given XSLT transformation:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output indent="yes"/>
    <xsl:template match="/">
        <xsl:apply-templates/>    
    </xsl:template> 
    <xsl:template match="Element2">
        <xsl:element name="{name()}">
            <xsl:attribute name="value"><xsl:value-of select="text()"/></xsl:attribute>
            <xsl:apply-templates select="./*"/>
        </xsl:element>
    </xsl:template>
    <xsl:template match='@*|node()'>
        <xsl:copy>
            <xsl:apply-templates select='@*|node()'/>
        </xsl:copy>
    </xsl:template>
</xsl:stylesheet>

produces desired result which is acceptable in PI:

<?xml version="1.0" encoding="utf-8"?>
<MT_RootNode>
   <Element1>
      <SubElement1>Value1</SubElement1>
   </Element1>
   <Element2 value="Value2">
      <SubElement2>Value3</SubElement2>
   </Element2>
</MT_RootNode>

Regards, Evgeniy.

Share
10 |10000 characters needed characters left characters exceeded
Evgeniy Kolmakov Feb 24, 2017 at 09:48 AM
0

Hi Piyush!

I guess links are broken. Please reload.

Regards, Evgeniy.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Evgeniy,

Please look into it now.

Regards

Piyush

0
Evgeniy Kolmakov Feb 24, 2017 at 10:25 AM
0

Hi Piyush!

Generally speaking, mixed type elements are not prohibited in XML. What is your requirement? What is your requirement for target structure?

You can use XSLT for moving previous value to attribute instead of subelement, for example.

Regards, Evgeniy.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks Evgeniy.

Can we achieve this using graphical mapping in SAP PO if you are aware of PO.We have 100 nodes to deal with,will it be feasible to use XSLT mapping?

And how can we do this using XSLT?

Regards

Piyush

0