cancel
Showing results for 
Search instead for 
Did you mean: 

Recursive node in xsd

Former Member
0 Kudos

Hello PI people.

I have a problem reguarding to a XSD file (standard DSML found here: [DSMLv2|http://www.oasis-open.org/committees/dsml/docs/DSMLv2.xsd]).

When I Import it as external definition to PI Integration builder it all works fine but if I undfold the message "Filter" the there is problem with the defintions for "not" and after one more fold on "and" or "or" the same problem is shown. It looks like PI understands the XSD but it just not permit recursive nodes?

Is it the XSD that dosent meet the PI standard or is it a internal thing in PI that needs to be activated to handle recursive nodes i XSD?

(When a message is mapped with this DSML all the error prone nodes are stripped..)

// Jesper

Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

When I Import it as external definition to PI Integration builder it all works fine but if I undfold the message "Filter" the there is problem with the defintions for "not" and after one more fold on "and" or "or" the same problem is shown. It looks like PI understands the XSD but it just not permit recursive nodes?

There is something wrong with this XSD. The filter node calls itself recursively (open in External Definition to see what I mean), if you use the ctrl+f function in message mapping and then type or, and, and not, the mapping willl hang...

What you can do is to request the provider to fix it.

Hope this helps,

Mark

Former Member
0 Kudos

Yea the filter is defined recursively but that is valid in xsd.

If you mouse over the "not" in external definitions the error "ERROR node is recursive" also is shown.

So my question is; can you make recursion in PI-XSD and if you can how?

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

If you mouse over the "not" in external definitions the error "ERROR node is recursive" also is shown.

So my question is; can you make recursion in PI-XSD and if you can how?

This is not possible because it will result in an infinite loop (remember that memory is finite) and your application will hang.

Hope this helps,

Mark

Former Member
0 Kudos

It should only result in a infinite loop if the XML recivied is infinite and thats not possible?

markangelo_dihiansan
Active Contributor
0 Kudos

Hello Jesper,

You can refer to this document for supported XSD and WSDL:

http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00a9a425-1769-2a10-9196-bd8eeed72...

Once you open this excel document go to row 94 for Recursive Data Structures, it says it is supported but there is a reference to row 143 which says


Recursive data structure must be expanded in design-time manually to the desired depth

If what you are thinking is dynamic recursion, then it is not possible. You have to use Java Mapping/XSLT for that. Now as for the nodes not displaying, right-click on the node and then select expand recursive structure.

Hope this helps,

Mark

stefan_grube
Active Contributor
0 Kudos

> It should only result in a infinite loop if the XML recivied is infinite and thats not possible?

Not infinite, but you do not know the number of recursions. PI must know the number of recursions to create a mapping.

If you do not know this before you map, you only can map the whole node with all subnodes without interpreting the content.

The same applies for the anytype declarations in the xsd. ou cannot map this as you do not know what you will have at runtime.

The xsd is valid according to xsd standard, but the design is bad. Instead of recursice subnodes, which are difficult to handle, it could use siblings instead.

I recommend using XSLT or Java mapping, this can recursively go through the subnodes. Graphical mapping tool is not able to do this because it is designed to run fast, so some restrictions have to be accepted.

Former Member
0 Kudos

Stefan,

Can you also explain how to achieve this in a XSLT map or a JAVA map. Any pointers would be great

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Hi Shyam,

                Doing recursion is quite simpe in java.  You can try java mapping to achieve this. Please refer the below link for understanding recursive pattern in java..

Recursion in Java with example – Programming Techniques Tutorial

Former Member
0 Kudos

Hey Bhaskar,

Sorry for the late reply.

My question is , I have a WSDL and at this moment this is not being activated and failing to activate because of recursive elements.

how do i even pass to a design phase by overcoming this?

V.SS

Answers (0)