on 03-29-2006 12:08 AM
hi! can anyone tell me how to generate an element in a target XML messages a constant number of times. similar kind of idea as useoneasmany() but with a fixed value for the number of 'many' instead of a node in the source message. any ideas appreciated and points awarded. thx, duncan
hi Praveen... thanks for the reply. I am using a standard schema which sets the note properties as min 1 and max 2. I don't want to modify the schema as that means I am changing a standard that is used by multiple trading partners on their system. I just need to force for one use case that the the node is genarated the maximum of two times. any other ideas? thx, duncan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Create a simple user defined function which doesnt take any input but gives an array with elements equal to the required no of nodes. And assign this output in combination with splitByValues and/or collpseContexts depending on your need regarding the context change.
for(int i=0; i<maxoccurs; i++)
result.addValue("");
Hi,
You can do this by writing a user defined function.
source node -> function -> <target node>
<target node>
In the function, declare a ResultList. Add the number of nodes you want to the ResultList.
Regards,
Smitha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can do this as suggested by Smitha Rao, i.e.
sourcenode--\
|>functionCreate>Targetnode
Constant----/
code for functionCretae
public void functionCreate(String[] source,String[] constantStr, ResultList result,Container container){
int constant = Integer.parseInt(constantStr[0]);
for(int i=0;i<constant;i++)
result.addValue(source[0]);
}
Regards,
KNS Kumar.
If you want the node to be created fixed number of times and if you know it design time...you can set that in data type...minoccurs = maxoccurs = <fixd_no>.
If it is known only at the runtime, you can use the determining source node or use the node funtion collapseContext. You need to give an array with required number of nodes as input to collapse context.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.