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

📄 expat.html

📁 perl教程
💻 HTML
📖 第 1 页 / 共 3 页
字号:
</li>
<dt><strong><a name="item_depth">depth</a></strong>

<dd>
<p>Returns the size of the context list.</p>
</dd>
</li>
<dt><strong><a name="item_element_index">element_index</a></strong>

<dd>
<p>Returns an integer that is the depth-first visit order of the current
element. This will be zero outside of the root element. For example,
this will return 1 when called from the start handler for the root element
start tag.</p>
</dd>
</li>
<dt><strong><a name="item_skip_until"><code>skip_until(INDEX)</code></a></strong>

<dd>
<p>INDEX is an integer that represents an element index. When this method
is called, all handlers are suspended until the start tag for an element
that has an index number equal to INDEX is seen. If a start handler has
been set, then this is the first tag that the start handler will see
after skip_until has been called.</p>
</dd>
</li>
<dt><strong><a name="item_position_in_context"><code>position_in_context(LINES)</code></a></strong>

<dd>
<p>Returns a string that shows the current parse position. LINES should be
an integer &gt;= 0 that represents the number of lines on either side of the
current parse line to place into the returned string.</p>
</dd>
</li>
<dt><strong><a name="item_xml_escape">xml_escape(TEXT [, CHAR [, CHAR ...]])</a></strong>

<dd>
<p>Returns TEXT with markup characters turned into character entities. Any
additional characters provided as arguments are also turned into character
references where found in TEXT.</p>
</dd>
</li>
<dt><strong><a name="item_parse">parse (SOURCE)</a></strong>

<dd>
<p>The SOURCE parameter should either be a string containing the whole XML
document, or it should be an open IO::Handle. Only a single document
may be parsed for a given instance of XML::Parser::Expat, so this will croak
if it's been called previously for this instance.</p>
</dd>
</li>
<dt><strong><a name="item_parsestring"><code>parsestring(XML_DOC_STRING)</code></a></strong>

<dd>
<p>Parses the given string as an XML document. Only a single document may be
parsed for a given instance of XML::Parser::Expat, so this will die if either
parsestring or parsefile has been called for this instance previously.</p>
</dd>
<dd>
<p>This method is deprecated in favor of the parse method.</p>
</dd>
</li>
<dt><strong><a name="item_parsefile"><code>parsefile(FILENAME)</code></a></strong>

<dd>
<p>Parses the XML document in the given file. Will die if parsestring or
parsefile has been called previously for this instance.</p>
</dd>
</li>
<dt><strong><a name="item_is_defaulted"><code>is_defaulted(ATTNAME)</code></a></strong>

<dd>
<p>NO LONGER WORKS. To find out if an attribute is defaulted please use
the specified_attr method.</p>
</dd>
</li>
<dt><strong><a name="item_specified_attr">specified_attr</a></strong>

<dd>
<p>When the start handler receives lists of attributes and values, the
non-defaulted (i.e. explicitly specified) attributes occur in the list
first. This method returns the number of specified items in the list.
So if this number is equal to the length of the list, there were no
defaulted values. Otherwise the number points to the index of the
first defaulted attribute name.</p>
</dd>
</li>
<dt><strong><a name="item_finish">finish</a></strong>

<dd>
<p>Unsets all handlers (including internal ones that set context), but expat
continues parsing to the end of the document or until it finds an error.
It should finish up a lot faster than with the handlers set.</p>
</dd>
</li>
<dt><strong><a name="item_release">release</a></strong>

<dd>
<p>There are data structures used by XML::Parser::Expat that have circular
references. This means that these structures will never be garbage
collected unless these references are explicitly broken. Calling this
method breaks those references (and makes the instance unusable.)</p>
</dd>
<dd>
<p>Normally, higher level calls handle this for you, but if you are using
XML::Parser::Expat directly, then it's your responsibility to call it.</p>
</dd>
</li>
</dl>
<p>
</p>
<h2><a name="xml__parser__contentmodel_methods">XML::Parser::ContentModel Methods</a></h2>
<p>The element declaration handlers are passed objects of this class as the
content model of the element declaration. They also represent content
particles, components of a content model.</p>
<p>When referred to as a string, these objects are automagicly converted to a
string representation of the model (or content particle).</p>
<dl>
<dt><strong><a name="item_isempty">isempty</a></strong>

<dd>
<p>This method returns true if the object is &quot;EMPTY&quot;, false otherwise.</p>
</dd>
</li>
<dt><strong><a name="item_isany">isany</a></strong>

<dd>
<p>This method returns true if the object is &quot;ANY&quot;, false otherwise.</p>
</dd>
</li>
<dt><strong><a name="item_ismixed">ismixed</a></strong>

<dd>
<p>This method returns true if the object is &quot;(#PCDATA)&quot; or &quot;(#PCDATA|...)*&quot;,
false otherwise.</p>
</dd>
</li>
<dt><strong><a name="item_isname">isname</a></strong>

<dd>
<p>This method returns if the object is an element name.</p>
</dd>
</li>
<dt><strong><a name="item_ischoice">ischoice</a></strong>

<dd>
<p>This method returns true if the object is a choice of content particles.</p>
</dd>
</li>
<dt><strong><a name="item_isseq">isseq</a></strong>

<dd>
<p>This method returns true if the object is a sequence of content particles.</p>
</dd>
</li>
<dt><strong><a name="item_quant">quant</a></strong>

<dd>
<p>This method returns undef or a string representing the quantifier
('?', '*', '+') associated with the model or particle.</p>
</dd>
</li>
<dt><strong><a name="item_children">children</a></strong>

<dd>
<p>This method returns undef or (for mixed, choice, and sequence types)
an array of component content particles. There will always be at least
one component for choices and sequences, but for a mixed content model
of pure PCDATA, &quot;(#PCDATA)&quot;, then an undef is returned.</p>
</dd>
</li>
</dl>
<p>
</p>
<h2><a name="xml__parser__expatnb_methods">XML::Parser::ExpatNB Methods</a></h2>
<p>The class XML::Parser::ExpatNB is a subclass of XML::Parser::Expat used
for non-blocking access to the expat library. It does not support the parse,
parsestring, or parsefile methods, but it does have these additional methods:</p>
<dl>
<dt><strong><a name="item_parse_more"><code>parse_more(DATA)</code></a></strong>

<dd>
<p>Feed expat more text to munch on.</p>
</dd>
</li>
<dt><strong><a name="item_parse_done">parse_done</a></strong>

<dd>
<p>Tell expat that it's gotten the whole document.</p>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="functions">FUNCTIONS</a></h1>
<dl>
<dt><strong><a name="item_load_encoding">XML::Parser::Expat::load_encoding(ENCODING)</a></strong>

<dd>
<p>Load an external encoding. ENCODING is either the name of an encoding or
the name of a file. The basename is converted to lowercase and a '.enc'
extension is appended unless there's one already there. Then, unless
it's an absolute pathname (i.e. begins with '/'), the first file by that
name discovered in the @Encoding_Path path list is used.</p>
</dd>
<dd>
<p>The encoding in the file is loaded and kept in the %Encoding_Table
table. Earlier encodings of the same name are replaced.</p>
</dd>
<dd>
<p>This function is automaticly called by expat when it encounters an encoding
it doesn't know about. Expat shouldn't call this twice for the same
encoding name. The only reason users should use this function is to
explicitly load an encoding not contained in the @Encoding_Path list.</p>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="authors">AUTHORS</a></h1>
<p>Larry Wall &lt;<em><a href="mailto:larry@wall.org">larry@wall.org</a></em>&gt; wrote version 1.0.</p>
<p>Clark Cooper &lt;<em><a href="mailto:coopercc@netheaven.com">coopercc@netheaven.com</a></em>&gt; picked up support, changed the API
for this version (2.x), provided documentation, and added some standard
package features.</p>

</body>

</html>

⌨️ 快捷键说明

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