Skip to Content
avatar image
Former Member

Problem with Mixed Content XML in SAP PO 7.5

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Jun 15, 2017 at 10:44 AM

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

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 24, 2017 at 12:11 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 24, 2017 at 09:48 AM

    Hi Piyush!

    I guess links are broken. Please reload.

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 24, 2017 at 10:25 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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