4 Replies Latest reply: Jun 3, 2009 3:43 AM by 807588 RSS

    type of string to be parsed

    807588
      Hello !

      I am using Kxml parser to parse xml data from a server. It is working for all tags gets the information <>...</>. BUT when I try to get the tag
      <default-pic>/com_mediaviewcenter/mediagenerator.jsp?m=696d6167652f676966&f=vdDk3Fyc9078038051421CDA&s=thumb</default-pic>
      it generates the following error, and I couldnot solve this for many days. Can somebody help me? The error is :

      XmlPullParserException: unterminated entity ref (position:TEXT /com_mediaviewce...@8:85 in java.io.InputStreamReader@1cb37664)


      Thanks in advance!
        • 1. Re: type of string to be parsed
          800282
          kXML is not a part of Java's standard API. I'd try the kXML mailing list if I were you:
          [http://kxml.sourceforge.net/]
          • 2. Re: type of string to be parsed
            807588
            kibreab_tekle wrote:
            Hello !

            I am using Kxml parser to parse xml data from a server. It is working for all tags gets the information <>...</>. BUT when I try to get the tag
            <default-pic>/com_mediaviewcenter/mediagenerator.jsp?m=696d6167652f676966&f=vdDk3Fyc9078038051421CDA&s=thumb</default-pic>
            it generates the following error, and I couldnot solve this for many days. Can somebody help me? The error is :
            So it should, because that's not valid XML. The problem is the ampersands. You need either to replace & with &amp; or to wrap the path in <![CDATA[ ]]> brackets.
            • 3. Re: type of string to be parsed
              807588
              Tnx about it!


              But the problem is I cannot modify the server side, I have to just parse it. Is there anyway to get it work?

              Hope to hear soon!
              • 4. Re: type of string to be parsed
                807588
                If it's a simple message you might get away with interpreting it yourself using regular expressions. Otherwise I think your best chance would be to pre-process it into valid XML. Something like String.replaceAll("&(\\w+)=", "&amp;$1=") might do it, depending on what else is in there.

                And I'd probably complain to the service provider.

                Edited by: malcolmmc on Jun 3, 2009 9:42 AM

                Because forum ate &amp; as usual