Skip to Content
avatar image
Former Member

xsi type= "dynamic object"

Hi all,

I have a integration Proxy-->PO-->SOAP. We are using a standard XSD imported as an external definition to comunicate with the third party with several operations (below)

The message structure which must be send to third party is:

Out operation "ConfigurationBatch" is (below)

I need to add the attribute "xsi:type" to a specific tag "ConfigurationUpdate"

The schema relies on the “xsi:type” feature available in XML Schema Instance namespace (http://www.w3.org/2001/XMLSchema-instance). Xsi:type is a re-define or extension mechanism. It operates based on information in the XML instance. So the actual re-define isn’t in the schema, but it is created at run-time.

is it posible create a xslt for example to do this?

Thanks

Regards

operations.jpg (73.6 kB)
xsidynamic.jpg (121.7 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Mar 08, 2017 at 01:12 PM

    Hi Monica,

    You can try to rename the nodes with XSLT in a way less static that did, but with XSLT you can do it without a great effort

    http://stackoverflow.com/questions/7246666/how-do-i-rename-xml-tags-using-xslt

    Regards.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 07, 2017 at 01:13 PM

    Hi Monica,

    I had the same problem (in PI 7.0), but my XSD was simpler than yours and i decided to do a XSL mapping before the first mapping and to add manually in the XSL mapping the tags and retrieve the value with an easy xsl:value-of select.

    May be someone had a better way to do it.

    Regards.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 08, 2017 at 11:45 AM

    Hi Iñaki,

    the main problem is the dymanic structure, for this reason I have created a custom .xsd because I need offer something to SAP side (Proxy).

    Now when the message mapping finished we need replace the tag name with the name with xsi: type: so:

    Now we have the tag: <ConfigurationUpdateAccount>

    And the receiver is wating: <ConfigurationUpdate xsi:type="Account">

    Also I can have n ocurrences of tag <ConfigurationUpdateAccount>

    Could I do this with a .xslt method?

    Thanks

    Regards

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 09, 2017 at 11:35 AM

    Hi Iñaki,

    thanks for your link It was very useful, after we have some problems with prefix with namespace, etc but these were resolved.

    Thanks and regards

    Add comment
    10|10000 characters needed characters exceeded

    • Hello Monica,

      Could you let me know how you resolved this? I am facing the same issue. So far my XSLT is totally static, but even like that it is not working because it complains that the xsi:type namespace is not bound. In fact I have declared it via XSLT as well, adding the following to the root element:

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      Unfortunately I am still getting the namespace not bound error.

      Could you share your solution to this problem?

      If anybody else has experience with xsd:type any help would be appreciated as well of course.

      PS: Did you also make your XLST dynamic in such a way that you only have one xsl template for all your elements?