uTools-Manuals/docs/java/org/w3c/dom/ls/LSResourceResolver.html

117 lines
7.2 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="header">
<div class="subTitle">
compact2, compact3
</div>
<div class="subTitle">
org.w3c.dom.ls
</div>
<h2 class="title" title="Interface LSResourceResolver">Interface LSResourceResolver</h2>
</div><div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr/> <br/> <pre>public interface <span class="typeNameLabel">LSResourceResolver</span></pre>
<div class="block">
<span><code>LSResourceResolver</code>提供了一种应用程序将引用重定向到外部资源的方法。</span>
<p> <span>需要为外部资源实现自定义处理的应用程序可以通过设置<code>LSParser</code><code>LSSerializer</code>附带的<code>DOMConfiguration</code>对象的“资源解析器”参数来实现该接口并注册其<code>LSSerializer</code></span> <span>它也可以是上注册<code>DOMConfiguration</code>附着在物体上<code>Document</code>是否支持“LS”功能。</span> </p>
<p> <span><code>LSParser</code>将允许应用程序在包含外部实体包括外部DTD子集和外部参数实体之前拦截它们。</span> <span>顶级文档实体从不传递给<code>resolveResource</code>方法。</span> </p>
<p> <span>许多DOM应用程序不需要实现此接口但对于从数据库或其他专门的输入源构建XML文档的应用程序或使用URN的应用程序来说这将非常有用。</span> </p>
<p> <span><b>注意:</b> <code>LSResourceResolver</code>是基于SAX2 [ <a href="http://www.saxproject.org/">SAX</a> ] <code>EntityResolver</code>接口。</span> </p>
<p> <span>另见<a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407">Document Object Model (DOM) Level 3 Load and Save Specification</a></span> </p>
</div> </li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- --> </a> <h3>方法摘要</h3>
<table border="0" cellpadding="3" cellspacing="0" class="memberSummary" summary="Method Summary table, listing methods, and an explanation">
<caption>
<span class="activeTableTab" id="t0"><span>所有方法</span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t2"><span><a href="javascript:show(2);">接口方法</a></span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t3"><span><a href="javascript:show(4);">抽象方法</a></span><span class="tabEnd"> </span></span>
</caption>
<tbody>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor" id="i0">
<td class="colFirst"><code><a href="../../../../org/w3c/dom/ls/LSInput.html" title="interface in org.w3c.dom.ls">LSInput</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/w3c/dom/ls/LSResourceResolver.html#resolveResource-java.lang.String-java.lang.String-java.lang.String-java.lang.String-java.lang.String-">resolveResource</a></span>(<a href="../../../../java/lang/String.html" title="class in java.lang">String</a> type, <a href="../../../../java/lang/String.html" title="class in java.lang">String</a> namespaceURI, <a href="../../../../java/lang/String.html" title="class in java.lang">String</a> publicId, <a href="../../../../java/lang/String.html" title="class in java.lang">String</a> systemId, <a href="../../../../java/lang/String.html" title="class in java.lang">String</a> baseURI)</code>
<div class="block">
允许应用程序解决外部资源。
</div> </td>
</tr>
</tbody>
</table> </li>
</ul> </li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- --> </a> <h3>方法详细信息</h3> <a name="resolveResource-java.lang.String-java.lang.String-java.lang.String-java.lang.String-java.lang.String-">
<!-- --> </a>
<ul class="blockListLast">
<li class="blockList"> <h4>resolveResource</h4> <pre><a href="../../../../org/w3c/dom/ls/LSInput.html" title="interface in org.w3c.dom.ls">LSInput</a> resolveResource(<a href="../../../../java/lang/String.html" title="class in java.lang">String</a> type,
<a href="../../../../java/lang/String.html" title="class in java.lang">String</a> namespaceURI,
<a href="../../../../java/lang/String.html" title="class in java.lang">String</a> publicId,
<a href="../../../../java/lang/String.html" title="class in java.lang">String</a> systemId,
<a href="../../../../java/lang/String.html" title="class in java.lang">String</a> baseURI)</pre>
<div class="block">
<span>允许应用程序解决外部资源。</span>
<br/>
<span>在打开任何外部资源包括外部DTD子集DTD中引用的外部实体以及在文档元素中引用的外部实体但是顶层文档实体未传递给此方法之前 <code>LSParser</code>将会调用此方法。</span>
<span>然后,应用程序可以请求<code>LSParser</code>解析外部资源本身它使用替代URI或者使用完全不同的输入源。</span>
<br/>
<span>应用程序编写者可以使用此方法将外部系统标识符重定向到安全和/或本地URI以查找目录中的公共标识符或从数据库或其他输入源包括例如对话框读取实体</span>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<span><code>type</code> - 正在解析的资源类型。</span>
<span>对于XML [ <a href="http://www.w3.org/TR/2004/REC-xml-20040204">XML 1.0</a> ]资源(即实体),应用程序必须使用值<code>"http://www.w3.org/TR/REC-xml"</code></span>
<span>对于XML Schema [ <a href="http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/">XML Schema Part 1</a> ],应用程序必须使用值<code>"http://www.w3.org/2001/XMLSchema"</code></span>
<span>其他类型的资源在本规范的范围之外因此应该推荐使用绝对URI来使用此方法。</span>
</dd>
<dd>
<code>namespaceURI</code> - 正在解析的资源的命名空间例如解析XML模式
<a href="http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/">资源</a>时的XML模式[
<a href="http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/">XML Schema Part 1</a> ]的目标命名空间。
</dd>
<dd>
<code>publicId</code> -外部实体的公共标识符被引用,或
<code>null</code>如果没有公共标识符供给或如果资源不是实体。
</dd>
<dd>
<code>systemId</code> -系统标识符一个URI引用[
<a href="http://www.ietf.org/rfc/rfc2396.txt">IETF RFC 2396</a>外部资源的],被参考,或
<code>null</code>如果提供没有系统标识符。
</dd>
<dd>
<code>baseURI</code> - 要解析的资源的绝对基本URI如果没有基本URI
<code>null</code>
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
<code>LSInput</code>对象描述新的输入源,或
<code>null</code>以请求解析器打开一个定期URI连接到资源。
</dd>
</dl> </li>
</ul> </li>
</ul> </li>
</ul>
</div>
</div>