[#BloombergLP-balxml-ValidatingReader-addSchema]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balxml.adoc[balxml]::xref:BloombergLP/balxml/ValidatingReader.adoc[ValidatingReader]::addSchema
:relfileprefix: ../../../
:mrdocs:

Associate the specified `location` with the XSD document in the specified `schema` stream&period; Return 0 on success and non&hyphen;zero on error&period; This method may be called more than once to add multiple location&hyphen;schema associations to a pre&hyphen;resolved schema cache&period; During XML validation, a reference to a schema with a specific location will be looked up in the schema cache&period; Only if this resolution fails, is the schema resolver used to find the external schema&period; (See `setResolver` in the `Reader` base class&period;) The effects of calling this method when the reader is already open is not specified and a derived class implementation may treat it as an error&period; The behavior is undefined unless `schema` is a repositionable stream (i&period;e&period;, it must be possible to read from the stream, then seek to the beginning of the stream and read the same bytes again&period;)

== Synopsis

Declared in `&lt;balxml&lowbar;validatingreader&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
int
addSchema(
    char const* location,
    std::streambuf* schema) = 0;
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
