1. Shlomi Fish
  2. perl-XML-LibXML

Commits

ph...@9ae0c189-cd1f-4510-a509-f4891f5cf20d  committed 3024749

Modified Files:
LibXML.xs
+ XML::LibXML::Node::nodePath()
returns the XPath of a node

  • Participants
  • Parent commits b1f90bc
  • Branches default

Comments (0)

Files changed (1)

File LibXML.xs

View file
  • Ignore whitespace
         }
     OUTPUT:
         RETVAL
+
+
+SV * 
+nodePath( self )
+        xmlNodePtr self
+    PREINIT:
+        xmlChar * path = NULL;
+    CODE:
+        path = xmlGetNodePath( self );
+        if ( path == NULL ) {
+            croak( "cannot calculate path for the given node" );
+        }
+        RETVAL = nodeC2Sv( path, self );
+    OUTPUT:
+        RETVAL
         
 MODULE = XML::LibXML         PACKAGE = XML::LibXML::Element