Menu

#221 readXmlDatasets failed

1.4.0.0
closed
None
2018-11-07
2018-11-06
No

In Win_TRDP_VS2015 TRDP_XMLPrintTest project, the function readXmlDatasets failed to read the dataset parameters from example.xml file, may be the pXML handler is "corrupted".
I noted taht the placeHolder change after trdpXMLCountStartTag.

1 Attachments

Discussion

  • Bernd Löhr

    Bernd Löhr - 2018-11-06
    • status: open --> accepted
    • assigned_to: Stefan Bender
     
  • Bernd Löhr

    Bernd Löhr - 2018-11-06

    The parser seems sensitive to different line-endings. The problem shows up if parsing a unix (LF) xml file on Windows, e.g.

     
  • Simone Vitucci

    Simone Vitucci - 2018-11-07

    Hi Bernd,
    I fixed bug for Windows OS, changing option in fopen() from "r" to "r+b".

    /******************/
    /
    Opens the XML parsing.
    *

    • @param[in] pXML Pointer to local data
    • @param[in] file Pathname of XML file
      *
    • @retval none
      /
      TRDP_ERR_T trdp_XMLOpen (
      XML_HANDLE_T
      pXML,
      const char *file)
      {
      if ((pXML->infile = fopen(file, "r+b")) == NULL)
      {
      return TRDP_IO_ERR;
      }

      pXML->tagDepth = 0;
      pXML->tagDepthSeek = 0;
      pXML->error = TRDP_NO_ERR;
      return TRDP_NO_ERR;
      }

     
  • Stefan Bender

    Stefan Bender - 2018-11-07

    Thank you Simone, I can confirm that your bugfix works.

     
  • Stefan Bender

    Stefan Bender - 2018-11-07
    • status: accepted --> pending
     
  • Bernd Löhr

    Bernd Löhr - 2018-11-07
    • status: pending --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB