Unable to Parse ampersand while converting XML String to Document

As far I know only options is to Escape Special Characters. You can write a java code to handle this.

Doing the above will not change your xml string that you receive from your partner. Contact me on my email for more details and discussion.

sakthi , first of all & is not valid to be used within XML. it is not only the parsing issue within webMethods but any other parser would not parse the xml if it has the special character &.

I think the only solution would be to write a Service to accept the xml as input, replace & with the valid escape charters & and return the valid xml for you to parse.

Hi All,

I resolved this issue by replacing ‘&’ with '& amp;'and i m not seeing any failures now.

Regards,
Sakthi

I have a problem here - the xml received via file polling port to webMethods.

As we use file polling - the first service is xmlnode to document conversion - and this service fails when we have an & in xml .

Any ideas ?

We can’t do replace here being first service use - any better way to handle xml with & via file pollling ?

try passing the ffdata stream to stream to string (see if you get a valid xml string) if yes, then invoke xml string to node and proceed further.

Are you still having this issue ? I didn’t see any further comments. Try as he said.

THanks,

Actually the issue faced now is as below in the sent step for RN

:Send_External_Response_Document failed. com.wm.app.b2b.server.ServiceException: com.wm.estd.rosettaNet.RosettaNetException: com.wm.estd.rosettaNet.RosettaNetException: com.wm.estd.common.trp.IPException: Error: Error while executing service wm.estd.common.util:documentToRecords. Error Message: com.wm.lang.xml.WMDocumentException: [ISC.0042.9325] Element is missing end tag Suggested Action: Level: Level: Service Call Stack: org.w3c.dom.DOMException: com.wm.lang.xml.WMDocumentException: [ISC.0042.9325] Element is missing end tag at com.wm.lang.xml.Document.completeLoadDOM(Document.java:888) at com.wm.lang.xml.Node.getFirstChild(Node.java:1330) at com.wm.lang.xml.Document.getFirstChild(Document.java:1324) at com.wm.estd.common.util.DocumentToRecordService.recursiveCollect(DocumentToRecordService.java:517) at

Service -wm.prt.dispatch:handleTransition
Here ProprietaryDocumentIdentifier is having & and hence the problem .
Any suggestions on this ?