BloombergLP::balxml::Reader::open

Set up the reader for parsing the XML file named by filename.

Synopsis

Declared in <balxml_reader.h>

virtual
int
open(
    char const* filename,
    char const* encoding = 0) = 0;

Description

Set the encoding value to the optionally specified encoding ("ASCII", "UTF-8", etc). Returns 0 on success and non-zero otherwise. The encoding passed to Reader::open will take effect only when there is no encoding information in the original document, i.e., the encoding information obtained from the XML file described by the filename trumps all. If there is no encoding provided within the document and encoding is null or a blank string is passed, then set the encoding to the default "UTF-8". It is an error to open a reader that is already open. Note that the reader will not be on a valid node until advanceToNextNode is called.

Return Value

0 on success and non-zero otherwise

Parameters

NameDescription
filenamepath of the XML file to parse
encodingoptional document encoding override