Go Back

User login

Frontpage Sponsor


How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
200 - 500 GB
500 - 800 GB
800 - 1200 GB
1200 - 1500 GB
1500 - 2000 GB
> 2000 GB
Total votes: 65

Baanboard at LinkedIn

Reference Content

De-serialize XML Object
By patvdv at 26 Feb 2008 - 21:57

De-serialize XML Object


 long xmlRead(long fp, ref string error, [ long whitespacehandling ] )
 long xmlReadFromString(string xmlString, ref string error, [ long whitespacehandling ] )

XML library function

 XmlNodePointer xmlRead(STREAM *fp, char *parserError, XmlContextPointer pContext);
 XmlNodePointer xmlReadExt(STREAM *fp, char *parserError, XmlWhiteSpaceHandling whiteSpaceHandling, XmlContextPointer pContext);
 XmlNodePointer xmlReadBuffer(char *buffer, unsigned long bufferSize, char *parserError, XmlContextPointer pContext);
 XmlNodePointer xmlReadBufferExt(char *buffer, unsigned long bufferSize,char * parserError, XmlWhiteSpaceHandling whiteSpaceHandling, XmlContextPointer pContext);


De-serialize an XML object by parsing an XML document and creating an in-memory object tree.



fp must be a file pointer opened for read obtained from a call to,, ims.openfba() or ims.openvba().


xmlString must be a string buffer which contains an XML document.


error contains a description of the error in case a parsing error occurs. This is an English text, which can be used for logging purposes. Maximum length of this error string is 120 characters.


whitespacehandling can have one of the three values XmlWhiteSpaceLegacyMode, XmlPreserveWhiteSpace, and XmlReplaceWhiteSpaceBySingleSpace. When this optional argument is not supplied, the value XmlWhiteSpaceLegacyMode is assumed. The meaning of the allowed values is as follows.


XmlWhiteSpaceLegacyMode means that white space is handled the same way as it was done in older versions of these functions, which did not have the whitespacehandling argument. This means (1) that each newline character in the input starts a new data node, (2) that leading white space in a data node is removed, and (3) that empty data nodes are removed.


XmlPreserveWhiteSpace means that all white space in the XML document is preserved.


XmlReplaceWhiteSpaceBySingleSpace means (1) that leading and trailing white space in a data node is removed, (2) that empty data nodes are removed, and (3) that internal white space in a data node is replaced by one single space character.

It is possible to switch between the two modes XmlPreserveWhiteSpace and XmlReplaceWhiteSpaceBySingleSpace by means of the xml:space attribute. The value "preserve" switches the mode to XmlPreserveWhiteSpace. The value "default" (or any other value than "preserve") switches the mode to XmlReplaceWhiteSpaceBySingleSpace. The value of the xml:space attribute is considered to apply to all elements within the content of the element where it is specified, unless overriden with another instance of the xml:space attribute. See also [XMLSTD], Section 2.10.

In XmlWhiteSpaceLegacyMode, the xml:space attribute is ignored.

Return values

Success; A reference to the first in-memory node when successful.



Related topics

No votes yet

All times are GMT +2. The time now is 03:07.

©2001-2018 - -