cvs: peardoc /en/package xml.xml /en/package/xml xml-statistics.xml /en/package/xml/xml-statistics example.xml intro.xml
/en/package/xml/xml-statistics/xml-statistics apiversion.xml

From: Date: Mon, 22 Sep 2003 09:06:57 +0000
Subject: cvs: peardoc /en/package xml.xml /en/package/xml xml-statistics.xml /en/package/xml/xml-statistics example.xml intro.xml
/en/package/xml/xml-statistics/xml-statistics apiversion.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-1540@lists.php.net to get a copy of this message
schst Mon Sep 22 05:06:57 2003 EDT Added files: /peardoc/en/package/xml xml-statistics.xml /peardoc/en/package/xml/xml-statistics example.xml intro.xml /peardoc/en/package/xml/xml-statistics/xml-statistics apiversion.xml Modified files: /peardoc/en/package xml.xml Log: added intro and example for XML_Statistics Index: peardoc/en/package/xml.xml diff -u peardoc/en/package/xml.xml:1.7 peardoc/en/package/xml.xml:1.8 --- peardoc/en/package/xml.xml:1.7 Tue Sep 9 15:47:38 2003 +++ peardoc/en/package/xml.xml Mon Sep 22 05:06:55 2003 @@ -10,6 +10,7 @@ &package.xml.xml-rss; &package.xml.xml-serializer; &package.xml.xml-sql2xml; + &package.xml.xml-statistics; &package.xml.xml-transformer; &package.xml.xml-tree; &package.xml.xml-util; Index: peardoc/en/package/xml/xml-statistics.xml +++ peardoc/en/package/xml/xml-statistics.xml <!-- $Revision: 1.1 $ --> <sect1 id="package.xml.xml-statistics"> <title>XML_Statistics</title> <para> Package to statistically analyze an XML document. </para> &package.xml.xml-statistics.intro; &package.xml.xml-statistics.example; &package.xml.xml-statistics.xml-statistics.apiversion; </sect1> <!-- 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 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 --> Index: peardoc/en/package/xml/xml-statistics/example.xml +++ peardoc/en/package/xml/xml-statistics/example.xml <!-- $Revision: 1.1 $ --> <refentry id="package.xml.xml-statistics.example"> <refnamediv> <refname>Example</refname> <refpurpose>Example for the usage of XML_Statistics</refpurpose> </refnamediv> <refsect1 id="package.xml.xml-statistics.example.example1"> <title>Usage example</title> <simpara> The following examples shows how XML_Statistics can be used to analyze a document. </simpara> <example> <title>Basic example</title> <programlisting role="php"> <![CDATA[require_once "XML/Statistics.php"; $stat = new XML_Statistics(array("ignoreWhitespace" => true)); $result = $stat->analyzeFile("example.xml"); if ($stat->isError($result)) { die("Error: " . $result->getMessage()); } // total amount of tags: echo "Total tags: " . $stat->countTag()."<br>"; // count amount of 'title' attribute, in all tags echo "Occurences of attribute title: " . $stat->countAttribute("title")."<br>"; // count amount of 'title' attribute, only in <section> tags echo "Occurences of attribute title in tag section: " . $stat->countAttribute("title", "section")."<br>"; // count total number of tags in depth 4 echo "Amount of Tags in depth 4: " . $stat->countTagsInDepth(4)."<br>"; echo "Occurences of PHP Blocks: " . $stat->countPI("PHP")."<br>"; echo "Occurences of external entity 'bar': " . $stat->countExternalEntity("bar")."<br>"; echo "Data chunks: " . $stat->countDataChunks()."<br>"; echo "Length of all data chunks: " . $stat->getCDataLength()."<br>"; ]]> </programlisting> </example> </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 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 --> Index: peardoc/en/package/xml/xml-statistics/intro.xml +++ peardoc/en/package/xml/xml-statistics/intro.xml <!-- $Revision: 1.1 $ --> <refentry id="package.xml.xml-statistics.intro"> <refnamediv> <refname>Introduction</refname> <refpurpose>Introduction to XML_Statistics</refpurpose> </refnamediv> <refsect1 id="package.xml.xml-statistics.intro.refsect1"> <title>Introduction to XML_Statistics</title> <para> XML_Statistics is a package that allows you to analyze XML documents, which can be files or strings. </para> <para> XML_Statistics is able to count tags, attributes, processing instructions, external entities and cdata blocks. Furthermore you can apply filters so you are able to count only the tags in a specific depth or only the attributes of a specific tag. </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 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 --> Index: peardoc/en/package/xml/xml-statistics/xml-statistics/apiversion.xml +++ peardoc/en/package/xml/xml-statistics/xml-statistics/apiversion.xml <!-- $Revision: 1.1 $ --> <refentry id="package.xml.xml-statistics.xml-statistics.apiversion"> <refnamediv> <refname><function>XML_Statistics::apiVersion</function></refname> <refpurpose>return API version</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'XML/Util.php'; </funcsynopsisinfo> <funcprototype> <funcdef>string <function>XML_Statistics::apiVersion</function></funcdef> <paramdef></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.xml.xml-statistics.xml-statistics.apiversion.desc"> &title.desc; <para> Returns API version of XML_Statistics. </para> </refsect1> <refsect1 id="package.xml.xml-statistics.xml-statistics.apiversion.return"> &title.returns; <para> <emphasis>string</emphasis> API version </para> </refsect1> <refsect1 id="package.xml.xml-statistics.xml-statistics.apiversion.note"> &title.note; &note.canstatic; </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 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 -->

« previous php.pear.doc (#1540) next »