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.
The parser seems sensitive to different line-endings. The problem shows up if parsing a unix (LF) xml file on Windows, e.g.
Hi Bernd, I fixed bug for Windows OS, changing option in fopen() from "r" to "r+b".
/******************/ / Opens the XML parsing. *
@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; }
Thank you Simone, I can confirm that your bugfix works.
Log in to post a comment.
The parser seems sensitive to different line-endings. The problem shows up if parsing a unix (LF) xml file on Windows, e.g.
Hi Bernd,
I fixed bug for Windows OS, changing option in fopen() from "r" to "r+b".
/******************/
/ Opens the XML parsing.
*
*
@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;
}
Thank you Simone, I can confirm that your bugfix works.