mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Documented DOMNode::getLineNo()
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@282948 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
d9b353ef65
commit
40182f6a9b
2 changed files with 93 additions and 1 deletions
91
reference/dom/domnode/getlineno.xml
Normal file
91
reference/dom/domnode/getlineno.xml
Normal file
|
@ -0,0 +1,91 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="domnode.getlineno" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DOMNode::getLineNo</refname>
|
||||
<refpurpose>Get line number for a node</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>int</type><methodname>DOMNode::getLineNo</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Gets line number for where the node is defined.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
&no.function.parameters;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Always returns the line number where the node was defined in.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><methodname>DOMNode::getLineNo</methodname> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// XML dump for below exmaple
|
||||
$xml = <<<XML
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<root>
|
||||
<node />
|
||||
</root>
|
||||
XML;
|
||||
|
||||
// Create a new DOMDocument instance
|
||||
$dom = new DOMDocument;
|
||||
|
||||
// Load the XML
|
||||
$dom->loadXML($xml);
|
||||
|
||||
// Print where the line where the 'node' element was defined in
|
||||
printf('The <node> tag is defined in line %d', $dom->getElementsByTagName('node')->item(0)->getLineNo());
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
The <node> tag is defined in line 3
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!--
|
||||
Do NOT translate this file
|
||||
-->
|
||||
|
@ -103,6 +103,7 @@
|
|||
<function name='domnode::clonenode' from='PHP 5'/>
|
||||
<function name='domnode::comparedocumentposition' from='PHP 5'/>
|
||||
<function name='domnode::getfeature' from='PHP 5'/>
|
||||
<function name='domnode::getlineno' from='PHP 5 >= 5.3.0'/>
|
||||
<function name='domnode::getnodepath' from='PHP 5 >= 5.2.0'/>
|
||||
<function name='domnode::getuserdata' from='PHP 5'/>
|
||||
<function name='domnode::hasattributes' from='PHP 5'/>
|
||||
|
|
Loading…
Reference in a new issue