XML Parse error

Home Forums kbmMW XML Parse error

Viewing 1 reply thread
  • Author
    Posts
    • #54363
      Ercüment USTA
      Participant

      Dear Sirs,

      We are using Delphi 10.2 and C++ Builder 10.2 Update 3 and we have upgraded to kbmMW 5.10.10 from version 5.02.10.
      But we have problems in parsing the XMLs including CDATA when using the new version.

      The XML samples we couldn’t parse are below:
      1.
      <root>
      <item>
      <![CDATA[ if ( x < y ) then x = y ]]>
      </item>
      </root>

      2.
      <root>
      <item>
      <fxml>
      <![CDATA[ <root><item><script><![CDATA[ if ( x < y ) then x = y ]]></script></item></root> ]]>
      </fxml>
      </item>
      </root>

      The function we are trying to read:
      bool __fastcall ReadDynFiles(TMemoryStream *ms)
      {
      TkbmMWCustomDOMXMLParser* ADOM = new TkbmMWCustomDOMXMLParser();
      bool Ret = true;

      try {
      ms->Position = 0;
      ADOM->SetStream(ms);
      try {
      ADOM->Parse(); <<<<<<<<<< KBMMW_ERR_TRANSPORT_XML_INVALIDFORMAT
      CreateDynObjects(ADOM->Root->Nodes->Nodes[0]);
      } catch(Exception &e) {
      if (FbxLogView) FbxLogView(“Parse Error : ” + ServiceErrorTable(e.HelpContext) + e.Message);
      Ret = false;
      }
      } __finally {
      delete ADOM;
      }
      return Ret;
      }

      On the function “procedure PushNode(const ANode:TkbmMWDOMXMLNode);” in the kbmMWXML.pas source code, it gives the error
      “kbmMWRaiseException(KBMMW_ERR_TRANSPORT_XML_INVALIDFORMAT,’Mismatched open and closing tag names’);”

      There is no problem in the old version, we are facing the problem in the new one.

      Thank you in advance,
      Ercüment USTA, Beyaz Yazilim Ltd.
      eusta@beyazyazilim.com

       

       

    • #54364
      kimbomadsen
      Keymaster

      Hi,

      I can confirm a bug in kbmMW’s CDATA parser. It is fixed in next release.

      Regarding your 2nd example. Nesting CDATA is not allowed in XML, why that will fail regardless.

      best regards

      Kim/C4D

Viewing 1 reply thread
  • You must be logged in to reply to this topic.