Xacobeo::XS3pm
Functions rewritten in xs.
Usage
use Xacobeo::XS;Xacobeo::XS->load_text_buffer($textview->get_buffer, $node, $namespaces);Xacobeo::XS->load_tree_store($treeview->get_store, $node, $namespaces);
Overview
This package provides some functions that are implemented through XS. These functions are much faster than their Perl counterpart.
Class methods
The following class methods are available:
load_text_buffer
Populates a Gtk2::TextBuffer with the contents of an XML::LibXML::Node. The elements and attributes are displayed with the prefix corresponding to their respective namespaces. The XML document is also displayed with proper syntax highlighting.
Parameters:
- •
-
$bufferThe text buffer to fill. Must be an instance of Gtk2::TextBuffer.
- •
-
$nodeThe node to display in the the text view. Must be an instance of XML::LibXML::Node.
- •
-
$namespacesThe namespaces declared in the document. Must be an hash ref where the keys are the URIs and the values the prefixes of the namespaces.
load_tree_store
Populates a Gtk2::TreeStore with the contents of an XML::LibXML::Node. The tree will display only the nodes of type element. Furthermore, the elements are displayed with the prefix corresponding to their respective namespaces.
Parameters:
- •
-
$storeThe text store to fill. Must be an instance of Gtk2::TreeStore.
- •
-
$nodeThe node to display in the the tree view. Must be an instance of XML::LibXML::Node.
- •
-
$namespacesThe namespaces declared in the document. Must be an hash ref where the keys are the URIs and the values the prefixes of the namespaces.
get_node_mark
Returns a unique identifier for the given node.
Parameters:
- •
-
$nodeThe node. Must be an instance of XML::LibXML::Node.
get_node_path
Returns a unique XPath path for the given XML::LibXML::Node. The path will use node names using the right prefixes.
Parameters:
- •
-
$nodeThe node for which the path has to be computed. Must be an instance of XML::LibXML::Node.
- •
-
$namespacesThe namespaces declared in the document. Must be an hash ref where the keys are the URIs and the values the prefixes of the namespaces.
Copyright and license
Copyright (C) 2008,2009 by Emmanuel Rodriguez.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
Releases
4 releases since Debian 6.0 (Squeeze); the text changed 3 times.