Commits

Shlomi Fish committed e8df9cf

Improved the documentation.

Comments (0)

Files changed (2)

         - https://rt.cpan.org/Ticket/Display.html?id=51439
     - https://rt.cpan.org/Ticket/Display.html?id=61756
         - << $node = XML::LibXML::Comment( $content ); >> is wrong.
+    - Documentation: moved away from Indirect-object-notation and added
+    some missing "my"s:
+        - http://www.modernperlbooks.com/mt/2009/08/the-problems-with-indirect-object-notation.html
 
 1.73            Sat Jun 18 10:53:44 IDT 2011
     - Calculating $err->column() properly, so it won't be maxed out at
     <sect1>
       <title>Synopsis</title>
       <programlisting>use XML::LibXML::Reader;</programlisting>
-      <programlisting>my $reader = new XML::LibXML::Reader(location =&gt; "file.xml")
+      <programlisting>my $reader = XML::LibXML::Reader-&gt;(location =&gt; "file.xml")
        or die "cannot read file.xml\n";
 while ($reader-&gt;read) {
   processNode($reader);
 }</programlisting>
       <programlisting>
 sub processNode {
-    $reader = shift;
+    my $reader = shift;
     printf "%d %d %s %d\n", ($reader-&gt;depth,
                              $reader-&gt;nodeType,
                              $reader-&gt;name,
 </programlisting>
       <para>or</para>
       <programlisting>
-  $reader = new XML::LibXML::Reader(location =&gt; "file.xml")
+  my $reader = XML::LibXML::Reader-&gt;(location =&gt; "file.xml")
        or die "cannot read file.xml\n";
   $reader-&gt;preservePattern('//table/tr');
   $reader-&gt;finish;
     <sect1>
       <title>Synopsis</title>
       <programlisting>use XML::LibXML;
-my $compiled_xpath = new XML::LibXML::XPathExpression('//foo[@bar="baz"][position()&lt;4]');
+my $compiled_xpath = XML::LibXML::XPathExpression-&gt;('//foo[@bar="baz"][position()&lt;4]');
 
 # interface from XML::LibXML::Node 
 
     <sect1>
       <title>Synopsis</title>
       <programlisting>use XML::LibXML;
-my $pattern = new XML::LibXML::Pattern('/x:html/x:body//x:div', { 'x' => 'http://www.w3.org/1999/xhtml' });
+my $pattern = XML::LibXML::Pattern-&gt;new('/x:html/x:body//x:div', { 'x' => 'http://www.w3.org/1999/xhtml' });
 # test a match on a XML::LibXML::Node $node
 
 if ($pattern->matchesNode($node)) { ... }
     <sect1>
       <title>Synopsis</title>
       <programlisting>use XML::LibXML;
-my $compiled_re = new XML::LibXML::RegExp('[0-9]{5}(-[0-9]{4})?');
+my $compiled_re = XML::LibXML::RegExp-&gt;('[0-9]{5}(-[0-9]{4})?');
 if ($compiled_re->isDeterministic()) { ... }
 if ($compiled_re->matches($string)) { ... }
 </programlisting>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.