Skip to Content
0

append payload showing "Multiple clones of root node is not allowed"

Sep 26, 2017 at 12:00 PM

71

avatar image
Former Member

image.pngHi Experts,

We have scenario from JMS to File receiver(with append mode we have appended the messages into file and placed in AL11 path ) now we are using the one more scenario (file to proxy)for picking those appended files from al11 , the files are picking from al11 but the payload have like below.

The payload have multiple root nodes for this we are using java mapping for removing those root nodes.

The XML page cannot be displayed

Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


Multiple colons are not allowed in a name. Error processing resource

Could you please provide suggestions.

image.png (13.6 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

7 Answers

Evgeniy Kolmakov Sep 26, 2017 at 02:51 PM
0

Hi Vijaya!

I guess that you append XML structures to one file at the first step?

Regards, Evgeniy.

Share
10 |10000 characters needed characters left characters exceeded
Evgeniy Kolmakov Oct 30, 2017 at 10:49 AM
0

Hi Vijaya!

Since well-formed XML should have one root node, I see two possible decisions from the first sight:

1.Use FCC at first step and save your XMLs as flat data and at the second step convert that cummulative flat file back to XML format.

2.Use java mapping not to remove root nodes but to add one common root node.

For example:

<root><aaa><bbb></bbb></aaa><aaa><bbb></bbb></aaa></root>

Regards, Evgeniy.

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Evgeniy,

Thanks for your reply.

I have a doubt to add root node if we add the root node we need to change any target structure(target is proxy-i mean to say we need to add that root node to target structure).

Thanks in advance.

Best Regards,

Vijaya

0

Hi Vijaya!

I don't know your target proxy structure. But I guess you always can use multimapping to split your source messages under root tag into separate messages and send it to proxy.

Regards, Evgeniy.

0
Evgeniy Kolmakov Oct 30, 2017 at 12:39 PM
0

Hi Vijaya!

As I have already told, wrap your message with common root tag using java mapping.

public void executeMapping(InputStream is, OutputStream os) throws StreamTransformationException {
try {
byte input[] = new byte[is.available()];
is.read(input);

String inxml = new String(input, "UTF-8");
String outxml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<ns0:MessageSet xmlns:ns0=\"http://tempuri.org\">" +
inxml.replace("<?xml version=\"1.0\" encoding=\"UTF-8\"?>", "") +
"</ns0:MessageSet>";
is.close();
os.write(outxml.getBytes("UTF-8"));
}
catch (Exception e) {
throw new StreamTransformationException(e.getMessage());
}
}

Regards, Evgeniy.


multixml.png (10.5 kB)
Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Oct 30, 2017 at 08:20 AM
0

Hi Evgeniy,

Sorry for the late reply.

Yes, in the first scenario(JMS->File) i am appended the xmls into file...In the 2nd scenario (file ->proxy)now that file is saying "is not well formed xml" in PO.

Best Regars,

Vijaya

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

Can you please share the XML vijaya.

0
avatar image
Former Member Oct 30, 2017 at 11:10 AM
0

Hi Raghuraman,

error.pngmaindocument1.txt

PFA payload and Error.Ho e to over this error, is there any posibilty to over come with xslt mapping or Java maping.

We have already using java mapping for removing multiple root nodes but payload itself is not come to PO.

Thanks in advance.

Best Regards,

Vijaya


error.png (21.5 kB)
Show 4 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hello Raghuraman,
According to the last attached payload the declaration string is still missing. So, the document part which Evgeniy was talking about is still not included in the payload:

<?xml version="1.0" encoding="UTF-8"?>
<ns0:MessageSet xmlns:ns0="http://tempuri.org">

Until the document will not be formed correctly it will not be accepted by validator. And you have got the error exactly about that.

Best regards,
Vadym

1
Former Member

Hi Diachenko,

Thank so much for your reply, yes while executing the OM it is failing saying that “it is not a well-formed xml".

Evgeniy: I got the reply from Evgeniy, he advised that need to add root node using the Java mapping but here my doubt is.....If OM is executing then java mapping will be executed. But In our case OM itself is failing. So we have to make sure that OM should be able to handle this not well-formed xml....the mapping itself failing while executing then how it will add root node.

And one more question here is our target is Proxy so we don't want to regenerate proxy because it is very critical interface and as per the Evgeniy if we add the root node on what occurrence we have to take for that added root node.

Could you please provide your suggestion on this?

Thanks in advance!!

Best Regards,

Vijaya

0

Hi Vijaya!

I guess Operation mapping itself doesn't fail but the message mapping within it does. Since no message structure validation is performed by default when using java mapping, you can use the mapping provided above as the first mapping in sequence to change the XML structure prior to perform the data transformation step.

As per proxy interface, you don't need to change proxy interface definition. Just adjust your mapping to transform your modified source structure to proxy message(s), for example, using multimapping. Thus you'll receive the set of messages of original proxy message type which is sent to proxy receiver one by one.

Regards, Evgeniy.

0
Former Member

Hi Evgeniy,

Sorry for the late reply.

Thank you for your inputs.

The message getting failing while executing the mapping step, so how it will execute java mapping.

I am confusing here,could you please explain elaborately.

Thanks in advance.

Regards,

Vijaya

0
avatar image
Former Member Nov 09, 2017 at 06:14 AM
0
Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Dec 11, 2017 at 11:16 AM
0

Hi Experts, could you please provide any solutions for this.

Regards,

Vijaya

Share
10 |10000 characters needed characters left characters exceeded