Commits

Anonymous committed c93c189

Modified Files:
Tag: mm_fix
Changes MANIFEST
version updates

example/libxml.xml
+ more docs :)

example/xml2pod.pl
+ now creates the correct filenames on "make docs"

  • Participants
  • Parent commits d8b0de9
  • Branches mm_fix

Comments (0)

Files changed (4)

    - made parse_xml_chunk() reporting errors
    - DOM API is more Level 3 conform
    - fixed the PI interface
+   - xpath.pl example 
+   - namespace fixes
 
 1.40
    - new parsefunction: $parser->parse_xml_chunk($string);
 example/complex/dtd/f.dtd
 example/complex/dtd/g.dtd
 example/ns.xml
+example/xpath.pl
 t/01basic.t
-t/02parsestring.t
-t/03parsefile.t
-t/04parsefh.t
-t/05dombasic.t
-t/06nodetypes.t
-t/07nodelist.t
+t/02parse.t
+t/03doc.t
+t/04node.t
+t/05text.t
+t/06elements.t
+t/07dtd.t
 t/08findnodes.t
-t/09append.t
+t/09xpath.t
 t/10ns.t
 t/11memory.t
 t/12html.t
 t/17callbacks.t
 t/18docfree.t
 t/19encoding.t
+t/20extras.t
 lib/XML/LibXML/Attr.pod
 lib/XML/LibXML/Comment.pod
+lib/XML/LibXML/DOM.pod
 lib/XML/LibXML/Dtd.pod
 lib/XML/LibXML/Node.pod
 lib/XML/LibXML/CDATASection.pod

File example/libxml.xml

 <module name="XML::LibXML">
-    <version>1.41</version>
+    <version>1.49</version>
     <authors>
         <author>Matt Sergeant</author>
         <author>Christian Glahn</author>
                 XML::LibXML's DOM implementation tries to follow the
                 various DOM specs although not all interfaces are
                 implemented yet. Also there some efford is taken to
-                also to follow the XPath DOM extensions.
+                also to follow the XPath DOM extensions. There are 
+                many functions that are specified for DOM and already 
+		present in XML::LibXML's DOM API, but still not 
+                documented.
             </p>
+            <p>
+		Although XML::LibXML provides the more important interfaces 
+                to node structures, there are not all node types implemented 
+                (yet). The more common functions are provided by 
+                XML::LibXML::Node, so it should be possible to access most 
+		parts of the document. Since XML::LibXML wraps only the 
+		document structure provided by libxml2, XML::LibXML::Node 
+		will not work properly with nodes found in a DTD, since they
+		are not nodes in context of libxml2. 
+            </p>
+            <p>
+                Besides that XML::LibXML's DOM Api should provide
+                a more perlish interface to the DOM structure libxml2 
+                generates. 
+            </p>
+
         </description>
     </package>
     <package name="XML::LibXML::Document">
                 (e.g. with $CLASS->new()), the <em>toString</em>
                 function may not return the expected result.
             </p>
+            <p><st>NOTE:</st> XML::LibXML magic encoding may not work 
+               on all plattforms. Some platforms are known to have a broken
+               iconv(), which is partly used by libxml2.
+            </p>
             <p>
                 This seems like a limitation as long UTF8 encoding is
                 assured. If iso encoded strings come into play it is
                     not be copied, but removed from the original
                     document.
                 </p>
+                <p>
+		<st>NOTE:</st> Don't try to use importNode() to import 
+		subtrees that contain an entity reference - even if 
+		the entity reference is the root node of the subtree. 
+		This will cause serious problems to your program. This is
+		a limitation of libxml2 and not of XML::LibXML itself.
+		</p>
             </method>
 
         </description>
                 </p>
             </method>
 
+            <method name="isSameNode"
+                    synopsis="$bool = $node->isSameNode( $other_node );">
+                <p>
+                    returns TRUE (1) if the given nodes refer to the same
+                    nodestructure, otherwise FALSE (0) is returned.
+                </p>
+            </method>
             <method name="isEqual"
                     synopsis="$bool = $node->isEqual( $other_node );">
                 <p>
-                    returns TRUE (1) if documents refer to the same
-                    nodestructure, otherwise FALSE (0) is returned.
+                   depraced version of isSameNode().
                 </p>
+		<p><st>NOTE</st> isEqual will change behaviour to 
+		   follow the DOM specification</p>
             </method>
 
             <method name="getData" synopsis="$content = $node->getData()">
                     imported first.
                 </p>
             </method>
+            <method name="replaceNode" synopsis="$node->replaceNode($newNode);">
+		<p>
+		    This function is very similar to replaceChild(), but it 
+		    replaces the node itself rather than a childnode. This is 
+		    useful if a node found by any XPath function, should be 
+                    replaced.
+		</p>
+            </method>
 
             <method name="appendChild"
                     synopsis="$childnode = $node->appendChild( $childnode )">
                 </p>
             </method>
 
+            <method name="addSibling" synopsis="$node->addSibling($newNode);">
+                <p>
+		    addSibling() allows to add an additional node to the end of 
+                    a nodelist, defined by the given node.
+		</p>
+	    </method>
+
             <method name="cloneNode" 
                     synopsis="$newnode =$node->cloneNode( $deep )">
                 <p>
                     $deep is 0 only the current node will be copied.
                 </p>
             </method>
+            <method name="attributes" synopsis="@attrs =$node->attributes;">
+		<p>
+		    This function returns all attributes assigned to the 
+                    given node. if this function is called in scalar context, 
+		    it will return a XML::LibXML::NodeList.  
+		</p>
+            </method>
 
             <method name="getParentNode" 
                     synopsis="$parentnode = $node->getParentNode();">
             </method>
 
 
-            <method name="getAttributes"
-                    synopsis="@attributelist = $node->getAttributes;">
-                <p>
-                    returns all attribute nodes of the current node. 
-                </p>
-            </method>
-
-            <method name="attributes"
-                    synopsis="@attributelist = $node->attributes;">
-                <p>
-                    Alias for <st>getAttributes()</st>
-                </p>
-            </method>
-
 
             <method name="getAttributesNS" 
                     synopsis="@attributelist = $node->attributesNS( $URI );">
                 <p>
                     returns all attributes for the given namespace.
+                    (not implemented yet)
                 </p>
             </method>
 

File example/xml2pod.pl

 
     # open traget file
     my $fn = $node->getAttribute("name") . ".pod";
+    $fn =~ s/^XML::LibXML::// if $target_dir =~ /XML\/LibXML\//;
+
     open(OSTDOUT , ">&STDOUT");
     open(STDOUT,"> $target_dir/$fn")|| die "cannot create file $fn ($!)";