📄 api.html
字号:
<dd>If the last request to the server resulted in an error, this will return the Z39.50 error code which was returned. A non-zero return
indicates an error in which case the ErrorMessage and AdditionalInfo properties can be used to return additional info about the error.
<br><br>
Normally, a Z39.50 error will cause an actual error to be raised by the system. However, if custom error handling or trapping is enabled,
this property can be used to get the actual Z39.50 error which occurred, instead of the VB error that was thrown. See the section on
<a href="#Errors">Errors</a> for more details.
<br><br></dd>
<dt>ErrorMessage <i>read-only</i></dt>
<dd>If the last request to the server resulted in an error, this will return the Z39.50 error message which was returned, if any.<br><br></dd>
</dl>
<h3>Methods</h3>
<dl>
<dt>GetOption(name)</dt>
<dd>Returns a particular named option associated with result set. The name parameter is a string which is the name of the option.
If the option has never been set either an empty string is returned or a default
value. An attempt to get an unknown option will result in an error. See the section on <a href="#Options">Options</a> for more details.<br><br></dd>
<dt>GetRecord(which)</dt>
<dd>Returns a ZoomRecord. The which parameter is the number of the record to return from 0 to GetSize-1.<br><br></dd>
<dt>GetSize()</dt>
<dd>Returns the total number of records associated with the result set.<br><br></dd>
<dt>SetOption(name,value)</dt>
<dd>Sets a particular named option to a given value. The name parameter is a string which is the name of the option. The value
parameter is a string for the value. This method will return whatever the previous value for the given option was. If the option had
never been set either an empty string is returned or a default
value. An attempt to set an unknown option will result in an error. See the section on <a href="#Options">Options</a> for more details.<br><br></dd>
</dl>
<h2><a name="ZoomScanSet"></a>ZoomScanSet</h2>
<p>This object represents Z39.50 scan result.</p>
<p>The only way to create an instance of this object is by the ZoomConnection.Scan method.</p>
<h3>Properties</h3>
<dl>
<dt>AdditionalInfo <i>read-only</i></dt>
<dd>If the last request to the server resulted in additional information, this will return the Z39.50 additional information, if any.<br><br></dd>
<dt>Class <i>read-only</i></dt>
<dd>The name of this class 'ZoomScanSet'<br><br></dd>
<dt>ErrorCode <i>read-only</i></dt>
<dd>If the last request to the server resulted in an error, this will return the Z39.50 error code which was returned. A non-zero return
indicates an error in which case the ErrorMessage and AdditionalInfo properties can be used to return additional info about the error.
<br><br>
Normally, a Z39.50 error will cause an actual error to be raised by the system. However, if custom error handling or trapping is enabled,
this property can be used to get the actual Z39.50 error which occurred, instead of the VB error that was thrown. See the section on
<a href="#Errors">Errors</a> for more details.
<br><br></dd>
<dt>ErrorMessage <i>read-only</i></dt>
<dd>If the last request to the server resulted in an error, this will return the Z39.50 error message which was returned, if any.<br><br></dd>
</dl>
<h3>Methods</h3>
<dl>
<dt>GetField(which, field)</dt>
<dd>Return a string which is the value of a particulat scan field. The which parameter is the number of the scan record from 0 to GetSize-1.
The field parameter is a string which is the name of the field to return. Acceptible values for field are:
<ul>
<li>freq - the number of occurrences of the term</li>
<li>display - the display value for the term (currently always returns just the term)</li>
<li>attrs - TODO: always returns an empty string</li>
<li>alt - TODO: always returns an empty string</li>
<li>other - TODO: always returns an empty string</li>
</ul>
Any other value for field results in an error.
<br><br></dd>
<dt>GetOption(name)</dt>
<dd>Returns a particular named option associated with scan set. The name parameter is a string which is the name of the option.
If the option has never been set either an empty string is returned or a default
value. An attempt to get an unknown option will result in an error. See the section on <a href="#Options">Options</a> for more details.<br><br></dd>
<dt>GetSize()</dt>
<dd>Returns the total number of terms associated with the scan set.<br><br></dd>
<dt>GetTerm(which)</dt>
<dd>Return a string which is a particlar scan term. The which parameter is the number of the scan term to return from 0 to GetSize-1.</dd>
<dt>SetOption(name,value)</dt>
<dd>Sets a particular named option to a given value. The name parameter is a string which is the name of the option. The value
parameter is a string for the value. This method will return whatever the previous value for the given option was. If the option had
never been set either an empty string is returned or a default
value. An attempt to set an unknown option will result in an error. See the section on <a href="#Options">Options</a> for more details.<br><br></dd>
</dl>
<h2><a name="ZoomRecord"></a>ZoomRecord</h2>
<p>This object represents a record returned by a Z39.50 search.</p>
<p>The only way to create an instance of this object is by the ZoomResultSet.GetRecord method.</p>
<h3>Properties</h3>
<dl>
<dt>Class <i>read-only</i></dt>
<dd>The name of this class 'ZoomRecord'<br><br></dd>
<dt>Database <i>read-only</i> <i style="color:red">ZOOM Extension</i></dt>
<dd>Returns a string containing the name of the database containing the record<br><br>
<dt><a name="ZoomRecord.RawData">RawData([type]) <i>read-only</i></a></dt>
<dd>Returns the raw data for the record in various data types depending on the value of the type parameter.
The optional type parameter is an enumeration of types <i>suggesting</i> how the raw data should be returned. The possible values are:<br/><br/>
<dl>
<dt>RawDataDefault (0)</dt>
<dd>
This is the default if type is not specified. In this case, the type of data returned depends on the record syntax.
For octet aligned syntaxes, such as SUTRS or MARC,
the returned data will be a RawDataString (vbString). For other record syntaxes, such as GRS-1, the returned type will be a
RawDataPointer (vbLong) which is a pointer to a YAZ Z_External struct.
</dd>
<dt>RawDataString (vbString = 8)</dt>
<dd>For octet aligned syntaxes, such as SUTRS or MARC,
the returned data will be a variant string (vbString).
</dd>
<dt>RawDataByteArray (vbByte + vbArray = 17 + 8192 = 8209 )</dt>
<dd>For octet aligned syntaxes, such as SUTRS or MARC,
the returned data will be a variant array of bytes (vbByte + vbArray).
</dd>
<dt>RawDataPointer (vbLong = 3)</dt>
<dd>For octet-aligned record syntaxes, such as SUTRS or MARC, a variant long which is a pointer to the character buffer will be returned.
For other record syntaxes, a pointer to a YAZ Z_External struct is returned.
For non-octet aligned syntaxes, the RawDataPointer type
is the only type which is ever returned; this is why type is only considered a suggestion.<br><br>
This data type is mostly used internally, but it is provided for anyone interested in delving into the world of Win32 API
programming, or working directly with the YAZ data structs. You cannot assume that octet buffers pointed to by this value
are null terminated, so in some cases you will need to get the length before you can safely use the pointer (see the following
RawDataLength value).
</dd>
<dt>RawDataLength (-1)</dt>
<dd>Returns the length in bytes of the RawData, if it is known. If the length cannot be determined -1 is returned.
This value is mostly only used internally, but it may be required for correctly processing RawDataPointers.
</dd>
</dl>
</dd>
<dd>
<br>
After the RawData property is returned, the type parameter (if any) will contain the actual data type returned. The return type
can also be checked using the VB TypeName function, if desired.
<br><br>
<i style="color:red">NOTE:</i> Caution should be exercised when dealing with the vbString data type returned from this property,
especially when using various scripting languages, such a JScript or VBScript. The 8-bit character strings are automatically converted
into 16-bit Unicode wide character strings and back again. This conversion often assumes the string is Windows 1252 (or even worse 1250 et al.,
depending on the locale setting of the machine)
Characters in the
range hex 80 to 9F (and possibly others as well) are converted into their Unicode equivalents. The problem is that this conversion
may not be appropriate, depending on the original character encoding of the raw data.
To prevent this
from happening you should use the RawDataByteArray data type, and then convert the bytes into strings or other data types according to you own needs.
More details on this issue can be found under this
<a href="http://sourceforge.net/tracker/?func=detail&aid=596271&group_id=53790&atid=471601">Bug Report</a> on SourceForge.
<br><br>
</dd>
<dt>XMLData <i>read-only</i> <i style="color:red">ZOOM Extension</i></dt>
<dd>Returns an XML DOMDocument40 object for the record in its XML format. This property is supported for the following record syntaxes:<br><br>
<dl>
<dt><b>USmarc</b></dt>
<dd>The XML returned will conform to the <a href="http://www.loc.gov/standards/marcxml/">MARC 21 XML Schema</a>,
maintained by the Library of Congress. The 'marc:' prefix has been bound to the namespace for the MARC 21 XML schema.
Therefore, when referring to elements using XPath expression, remember to use the prefix, for example: //marc:datafield[@tag='245']<br><br></dd>
<dt><b>text-XML</b>, <b>XML</b>, or <b>application-XML</b></dt>
<dd>The XML string returned by the server is loaded into the DOM. The schema can vary.<br><br></dd>
<dt><b>OPAC</b></dt>
<dd>The XML returned will conform (roughly) to the <a href="http://www.itu.int/ITU-T/studygroups/com17/languages/X.693_0901.pdf">XML Encoding Rules for ASN.1</a>.
If MARC is used for the bibligraphicRecord portion of the OPAC, then the <a href="http://www.loc.gov/standards/marcxml/">MARC 21 XML Schema</a>,
maintained by the Library of Congress will be used in that section; likewise, if MARC is used for the holdingsData.
The 'marc:' prefix has been bound to the namespace for the MARC 21 XML schema.
Therefore, when referring to MARC elements using XPath expression, remember to use the prefix, for example: //marc:datafield[@tag='245'].
No namespace is used for the base XER elements for the OPAC record, so no namespace prefix is required.</dd>
</dl><br>
Currently, accessing this property for any other record syntaxes will result in an error. If the XML is not well-formed
an error will also be raised.<br><br>
Also note that the XML will not be validated even if the XML contains a reference to a DTD or Schema. If desired, you can validate the XML
via the DOMDocument.validate() method.
</dd>
</dl>
<h3>Methods</h3>
<dl>
<dt>GetField(spec, [opt])</dt>
<dd>Returns a string containing the data from a particular record field. The spec parameter is a string used to specify which field to return.
The spec syntax varies according to the record syntax. The opt parameter is optional. It may contain data required to further qualify the spec.
It is currently only used for XML record syntaxes to bind prefixes to namespaces for use in <a href="http://www.w3.org/TR/xpath">XPath expressions</a>.
The record syntaxes currently supported and the spec syntax are described below:<br><br>
<dl>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -