⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 api.html

📁 Z39.50协议客户端程序源码.只支持对单一数据库进行查询,返回记录格式为XML.
💻 HTML
📖 第 1 页 / 共 3 页
字号:
    		<dt><b>USmarc</b></dt>
    		<dd>
    			<table>
					<tr><td>spec</td><td>::=</td><td>MARCPath | XPath</td></tr>
					<tr><td>MARCPath</td><td>::=</td><td>leader['/'range] | controltag['/'range] | datatag['$'code['/'range]]</td></tr>
					<tr><td>leader</td><td>::=</td><td>000</td></tr>
					<tr><td>controlTag</td><td>::=</td><td>00[1-9]</td></tr>
					<tr><td>dataTag</td><td>::=</td><td>(0[1-9][0-9]|[1-9][0-9][0-9])</td></tr>
					<tr><td>range</td><td>::=</td><td>(\d+|\d+\-\d+)</td></tr>
					<tr><td>code</td><td>::=</td><td>[\da-z!"#$%&'()*+,-./:;<=>?{}_^`~\[\]\\]</td></tr>
					<tr><td>XPath</td><td>::=</td><td>&lt;Any string not starting with a digit will be interpretted as an <a href="http://www.w3.org/TR/xpath">XPath expression</a> against the
					MARC 21 XML version of the record.  All element names must use the 'marc:' prefix to specify the correct namespace.&gt;</td></tr>
					</table><br>

					<b>MARCPath Examples:</b> <i>000</i> - returns the marc leader; <i>008</i> - returns the complete 008 field; <i>008/6</i> - returns the 7th character of the 008 field;
					<i>245</i> - returns the complete 245 field; <i>245$a</i> - returns the $a subfields of the 245 field; <i>245$a/0-9</i> - returns the first 10 characters of the
					$a subfields of the 245 field.<br><br>

					If a MARCPath expression is used for the spec, the format of the returned field is: 'tag[/range] [indicators] fields', for example: <br><br>

					245 10 $a Some issues ...<br>
					008/0-5 990817<br><br>

					If there are multiples of a given field, each will be returned spearated by a Cr/Lf.<br><br>

					<b>XPath Examples:</b> <i>/marc:record/marc:controlfield[@tag='008']</i> - returns the complete 008 field;
					<i>/marc:record/marc:datafield[@tag='245']/marc:subfield[@code='a']</i> - returns the $a subfields of the 245 field.<br><br>

					If an XPath expression is used for the spec, an XML fragment string from the MARC
					XML will be returned, such as &lt;controlfield tag='008'&gt;...&lt;/controlfield&gt;.  Note
					that this will only be an XML fragment and may not be well-formed.<br><br>
				</dd>

				<dt><b>text-XML</b>, <b>XML</b>, or <b>application-XML</b></dt>
				<dd>For all XML syntaxes, the spec will be interpreted as an <a href="http://www.w3.org/TR/xpath">XPath expression</a>.  The optional opt
				parameter is used to bind prefixes to namespaces for the XPath expression, for example:<br><br>

				field = GetField("//marc:datafield[@tag='245']", "xmlns:marc='http://www.loc.gov/MARC21/slim'")<br><br>
				</dd>

				<dt><b>OPAC</b></dt>
				<dd>OPAC is converted to the XML Encoding, as previously described for the XMLData property, so XPath expressions may be used to query for specific
				fields, just as for XML.  The optional opt
				parameter is used to bind prefixes to namespaces for the XPath expression.  However, this shouldn't normally be required as the
				XML does not use namespaces for the base elements, and the marc prefix has already been bound in case any of the OPAC elements contained
				embedded MARC.
				</dd>
    	</dl><br>
    	If there is no field which matches the given spec, an empty string is returned.  If the GetField methods is used for an unsupported record syntax
    	an error is raised.<br><br>
    	</dd>

    	<dt>GetNumberOfFields()</dt>

    	<dd>Return the number of individual fields contained in the record.  The number of fields depends on the record syntax as described below:<br><br>
    	<table>
    		<tr><td><b>USmarc: </b></td><td>the total number of control fields plus the number of subfields in each data field, plus one for the MARC leader.
    		See the GetField method for details.</td></tr>

    		<tr><td><b>text-XML: </b><br><b>XML: </b><br><b>application-XML: </b></td><td>the total number of element nodes in the XML, including the root element
    		and all children, grandchildren, etc.</td></tr>

    		<tr><td><b>OPAC: </b></td><td>since OPAC is reprtesented as XML, the total number of element nodes in the XML, including the root element
    		and all children, grandchildren, etc.</td></tr>
    	</table><br>
    	If the number of fields is unknown, -1 is returned.
    	<br><br></dd>

    	<dt>GetRecordSyntax()</dt>

    	<dd>Return a string which is the name of the native record syntax for this record, such as 'USmarc', 'XML', or 'SUTRS'<br><br></dd>

      <dt>RenderRecord()</dt>

      <dd>Returns a string containing the record which has been marginally rendered for human consumption.  If a record syntaxes has no
      convenient rendering an empty string is returned.  For <b>OPAC</b> records a string containing the XML rendering is returned.  For other
      record syntaxes, whatever string YAZ returns is used.<br><br></dd>

    </dl>

    <h2><a name="Errors"></a>Errors</h2>
    <dl>
    <dt><b>Invalid query type '<i>type</i>'</b> [-2147221303]</dt>
    <dd>An attempt has been made to create a ZoomQuery using an invalid type parameter.<br><br></dd>

    <dt><b>ZOOM Error <i>ErrorCode</i>: <i>ErrorMessage</i> (<i>AdditionalInfo</i>)</b> [-2147221302]</dt>
    <dd>A Z39.50 server has returned an error in response to the most resent request.<br><br></dd>

    <dt><b>Invalid query 'querystring'</b> [-2147221301]</dt>
    <dd>An attempt has been made to create a ZoomQuery using an invalid querystring parameter.<br><br></dd>

    <dt><b>No record at position <i>position</i></b> [-2147221300]</dt>
    <dd>An attempt has been made to access a record that doesn't exist at the given position<br><br></dd>

    <dt><b>'<i>optionname</i>' not a valid option name</b> [-2147221299]</dt>
    <dd>An attempt has been made to get or set an option which is not valid<br><br></dd>

    <dt><b>'<i>fieldname</i>' not a valid scan field</b> [-2147221298]</dt>
    <dd>An attempt has been made to access a scan field which is not valid<br><br></dd>

    <dt><b>'<i>spec</i>' not a valid field specification</b> [-2147221297]</dt>
    <dd>The spec parameter used for the GetField method is not valid<br><br></dd>

    <dt><b>This method not supported for '<i>syntax</i>' records</b> [-2147221296]</dt>
    <dd>An attempt was made to use the GetField method on an unsupported record syntax<br><br></dd>

    <dt><b>Internal Error: <i>errorMsg</i></b> [-2147221295]</dt>
    <dd>Something unexpected happened; <i>errorMsg</i> will usually explain what and/or where, so you can report back to the developers.<br><br></dd>

    <dt><b>Unknown character encoding '<i>encoding</i>'</b> [-2147221294]</dt>
    <dd>An unknown character encoding indicator was found in the MARC leader.
    Currently, only 'a' for UTF-8 Unicode and ' ' for MARC-8 are supported.<br><br></dd>

    <dt><b>'<i>number</i>' is not a supported raw data type</b> [-2147221293]</dt>
    <dd>An unknown data type was requested for the RawData.<br><br></dd>

    <dt><b>MARC record is missing the record terminator</b> [-2147221273]</dt>
    <dd>The syntax of the MARC record does not appear to be valid, or the record does not follow the Z39.2-1994 standard.<br><br></dd>

    <dt><b>MARC record directory is missing the field terminator</b> [-2147221272]</dt>
    <dd>The syntax of the MARC record does not appear to be valid, or the record does not follow the Z39.2-1994 standard.<br><br></dd>

    <dt><b>MARC record has an invalid entry map</b> [-2147221271]</dt>
    <dd>The syntax of the MARC record does not appear to be valid, or the record does not follow the Z39.2-1994 standard.<br><br></dd>

    <dt><b>MARC record variable field is missing field terminator</b> [-2147221271]</dt>
    <dd>The syntax of the MARC record does not appear to be valid, or the record does not follow the Z39.2-1994 standard.<br><br></dd>

    <dt><b>MARC record missing control number</b> [-2147221270]</dt>
    <dd>The syntax of the MARC record does not appear to be valid, or the record does not follow the Z39.2-1994 standard.  All MARC records should have
    an 001 field, but this record does not.<br><br></dd>

    <dt><b>XML Error <i>code</i>: (<i>line</i>:<i>pos</i>) <i>reason</i></b> [-2147221269]</dt>
    <dd>The XML parser has encountered an error<br><br></dd>

    <dt><b>MARCFactory is not initialized (usually because of unsupported character encoding)</b> [-2147221268]</dt>
    <dd>An attempt was made to access some property of an unitialized MARCRecord.  A MARCRecord may be
    unitialized because of programmer error :-), or because the MARC contained an unsupported character encoding.<br><br></dd>

    <dt><b>MARC XML is not well-formed</b> [-2147221267]</dt>
    <dd>Something unexpected happened while trying to parse the MARC XML.<br><br></dd>

    <dt><b>MARC record contained implementation defined data '<i>data</i>' in a variable data field</b> [-2147221266]</dt>
    <dd>Even though the Z39.2-1994 standard supports an implementation defined region inside of data fields, the MARC 21 standard does not.<br><br></dd>

    <dt><b>MARC only supports 2 indicators per data field; <i>number</i> were found</b> [-2147221265]</dt>
    <dd>Even though the Z39.2-1994 standard supports an arbitrary number of indicators per data field, the MARC 21 standard requires exactly two.<br><br></dd>

    <dt><b>MARC Leader is invalid</b> [-2147221264]</dt>
    <dd>The MARC leader (first 24 bytes of record) appears to be corrupt, preventing any further parsing.<br><br></dd>

    <dt><b>WIN32 API Error: <i>details</i></b> [-2147221247]</dt>
    <dd>An unexpected error value was returned by a Win32 API function.<br><br></dd>

    <dt><b>The MSXML 4.0 parser does not appear to be installed</b> [-2147221246]</dt>
    <dd>The MSXML 4.0 parser is required, but it does not appear to be installed on the machine.<br><br></dd>

    </dl>

    <h2><a name="Warnings"></a>Warnings</h2>
    <p>These warning conditions are currently just ignored, but in future versions it will be possible to extract these warnings from the objects.</p>
    <dl>

    <dt><b>Unknown character encoding '<i>encoding</i>'</b> [110]</dt>
    <dd>An unknown character encoding indicator was found in the MARC leader.
    Currently, only 'a' for UTF-8 Unicode and ' ' for MARC-8 are supported.  If an unknown encoding is found, MARC-8 will be assumed.<br><br></dd>

    <dt><b>MARC record variable field is missing field terminator</b> [134]</dt>
    <dd>The syntax of the MARC record does not appear to be valid, or the record does not follow the Z39.2-1994 standard.  A record terminator
    seems to have been used instead of the expected field terminator.<br><br></dd>

    <dt><b>MARC record missing control number</b> [135]</dt>
    <dd>The syntax of the MARC record does not appear to be valid, or the record does not follow the Z39.2-1994 standard.  All MARC records should have
    an 001 field, but this record does not.<br><br></dd>

    <dt><b>Invalid character chr(<i>number</i>) found at position <i>position</i> and replaced with '<i>string</i>'</b> [700]</dt>
    <dd>A character which is not valid within a MARC record was encountered.  It was replaced with a string "<?char nn ?>" which is valid.<br><br></dd>

    <dt><b>'<i>character</i>' is not a valid value for the Leader, Entry Map, Length of implementation-defined field; using 0</b> [701]</dt>
    <dd>An unexpected character was found in the Leader, Entry Map, or Length of implementation-defined field.  It is
    being replaced with the '0' character.<br><br></dd>



		</dl>

    <h2><a name="Options"></a>Options</h2>
    <p>The supported options are exactly those supported by the
    <a href="http://www.indexdata.dk/yaz/doc/zoom.php">ZOOM functions of the YAZ Toolkit</a> from <a href="http://www.indexdata.dk/">Index Data</a>.
    Refer directly to the <a href="http://lcweb.loc.gov/z3950/agency/markup/markup.html">Z39.50 specifications</a> for additional details on these options.</p>
    <table border="1">
    <tr><th>Option</th><th>Description</th><th>Default</th></tr>

    <tr><th colspan="3">Connection Options</th></tr>

    <tr><td>implementationName</td><td>Name of Your client</td><td>none </td></tr>
    <tr><td>user</td><td>Authentication user name</td><td>none </td></tr>
    <tr><td>group</td><td>Authentication group name</td><td>none </td></tr>
    <tr><td>pass</td><td>Authentication password </td><td> none </td></tr>
    <tr><td>host</td><td>Target host. This setting is "read-only". It's automatically set internally when connecting to a target. </td><td> none </td></tr>
    <tr><td>proxy</td><td>Proxy host  none </td></tr>
    <tr><td>async</td><td>If true (1) the connection operates in asynchronous operation which means that all calls are non-blocking except ZOOM_event. </td><td> 0 </td></tr>
    <tr><td>maximumRecordSize</td><td>Maximum size of single record. </td><td> 1 MB </td></tr>
    <tr><td>preferredMessageSize</td><td>Maximum size of multiple records. </td><td> 1 MB </td></tr>
    <tr><td>lang</td><td>Language for negotiation. </td><td> none </td></tr>
    <tr><td>charset</td><td>Character set for negotiation. </td><td> none </td></tr>
    <tr><td>targetImplementationId</td><td>Implementation ID of target. </td><td> none </td></tr>
    <tr><td>targetImplementationName</td><td>Implementation name of target. </td><td> none </td></tr>
    <tr><td>targetImplementationVersion</td><td>Implementation version of target. </td><td> none </td></tr>

		<tr><th colspan="3">ResultSet Options</th></tr>

    <tr><td>piggyback</td><td> True (1) if piggyback should be used in searches; false (0) if not. </td><td> 1 </td></tr>
    <tr><td>start</td><td> Offset of first record to be retrieved from target. First record has offset 0 unlike the protocol specifications where first record has position 1.</td><td>  0 </td></tr>
    <tr><td>count</td><td> Number of records to be retrieved. </td><td> 0 </td></tr>
    <tr><td>elementSetName</td><td> Element-Set name of records. Most targets should honor element set name B and F for brief and full respectively. </td><td> none </td></tr>
    <tr><td>preferredRecordSyntax </td><td>Preferred Syntax, such as USMARC, SUTRS, etc. </td><td> none </td></tr>
    <tr><td>schema </td><td>Schema for retrieval, such as Gils-schema, Geo-schema, etc. </td><td> none </td></tr>
    <tr><td>smallSetUpperBound </td><td>If hits is less than or equal to this value, then target will return all records using small element set name </td><td> 0 </td></tr>
    <tr><td>largeSetLowerBound </td><td>If hits is greater than this value, the target will return no records. </td><td> 1 </td></tr>
    <tr><td>mediumSetPresentNumber</td><td> This value represents the number of records to be returned as part of a search when when hits is less than or equal to large set lower bound and if hits is greater than small set upper bound. </td><td> 0 </td></tr>
    <tr><td>smallSetElementSetName</td><td> The element set name to be used for small result sets. </td><td> none </td></tr>
    <tr><td>mediumSetElementSetName </td><td>The element set name to be for medium-sized result sets. </td><td> none </td></tr>
    <tr><td>databaseName</td><td> One or more database names separated by character plus (+).  </td><td>Default </td></tr>
    <tr><td>setname</td><td> Name of Result Set (Result Set ID). If this option isn't set, the ZOOM module will automatically allocate a result set name. </td><td> default </td></tr>

    <tr><th colspan="3">ScanSet Options</th></tr>

    <tr><td>number</td><td> Number of Scan Terms requested in next scan. After scan it holds the actual number of terms returned. </td><td> 10 </td></tr>
    <tr><td>position</td><td> Preferred Position of term in response in next scan; actual position after completion of scan. </td><td> 1 </td></tr>
    <tr><td>stepSize</td><td> Step Size </td><td> 0 </td></tr>
    <tr><td>scanStatus</td><td> An integer indicating the Scan Status of last scan. </td><td> 0 </td></tr>

    <tr><th colspan="3">Other Options</th></tr>

    <tr><td>timeout</td><td> An integer indicating the number of seconds to wait for a connection. </td><td> 15 </td></tr>
		</table>

  </body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -