PDA

View Full Version : XML Parsing issue


sid
03-29-2006, 07:01
Hi ,
I am getting below error while i run service pub.xml:XMLStringtoNode ,passing an XML which is having " & " in values of one of the tags.
*************************
com.wm.lang.flow.WattEvaluationException: com.wm.lang.xml.WMDocumentException: [ISC.0042.9325] Element <partnum> is missing end tag
**************************

Please suggest ,how can i handle such characters while XML parsing.
For the same kind of issue a service HTMLDecode is available,can i use it ?

Thanks

mcarlson
03-29-2006, 07:48
Sid,

I don't think th e "&amp;" is the issue. Make sure that there is an end tag for the "partnum" element.

<partnum>12345</partnum>

Mark

jaya0313
03-29-2006, 07:54
Error clearly mentions that the end tag is missing. Add the </partnum> and reprocess it. That should work.
Thanks
Jay

sid
03-29-2006, 11:07
Hi,
Its not a TAG issue.The XML i am passing is having the proper end TAG.

but its not parsing anything after "&"

Below is kind of value it has.

<partnum>MS9501-&amp;</partnum>


And so it not reading the closing tag of the line

Please suggest ,what can be done.
Thanks

jaya0313
03-29-2006, 11:25
Is this the only "&" you are having in the XML string.

srinivaswm
03-29-2006, 16:36
Sid;
It is an xml parser problem. It is not able to parse your & character. It is a special character issue. Need to use encoding and decoding special characters. Check if encoding input parameter set to UTF-8 helps. you can aslo use CDATA to ignore the content in tags. check other posts in the forum regarding special character issue.

chandan
11-13-2007, 01:33
Sid,

The escape characters like <, >, & etc... are changed to entity reference like &lt;, &gt;, &amp; etc... when being parsed. So you are getting the correct value in <partnum>MS9501-&amp;</partnum>. Just assign UTF-8 to 'encoding' and true to 'isXML' Service-in parameters of pub:xml:xmlStringToXMLNode.