Baanboard.com

Go Back   Baanboard.com

User login

Frontpage Sponsor

Main

Google search


Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
16%
200 - 500 GB
27%
500 - 800 GB
3%
800 - 1200 GB
11%
1200 - 1500 GB
11%
1500 - 2000 GB
14%
> 2000 GB
19%
Total votes: 37

Baanboard at LinkedIn


Reference Content

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

De-serialize XML Object

Synopsis

 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);

Description

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

Arguments

fp

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

xmlString

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

error

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

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

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

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

XmlReplaceWhiteSpaceBySingleSpace

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.

0

Error.

Related topics


0
No votes yet


All times are GMT +2. The time now is 23:44.


©2001-2018 - Baanboard.com - Baanforums.com