Xacobeo::UI::XPathEntry - XPath text entry
use Xacobeo::UI::XPathEntry; my $entry = Xacobeo::UI::XPathEntry->new(); my $markup = sprintf '<span color="grey" size="smaller">%s</span>', escape_xml_text(__("XPath Expression...")) ; $entry->set_empty_markup($markup); # Must set a document in order to find the namespaces that are allowed $entry->set_document($document); if ($entry->is_valid) { my $xpath = $entry->get_text my $node = $document->find($xpath); $result_view->load_node($node); }
A text entry that validates XPath expressions. This widget is a Gtk2::Ex::Entry::Pango.
The widget validates the text in realtime. In order to support validation for namespaces a document has to be set first.
The following properties are defined:
The document being displayed.
Indicates if the XPath expression beind displayed is valid based on the current document.
The following methods are available:
Creates a new instance. This is simply the parent's constructor.
Sets a the widget's document. A document is needed in order to provide the namespaces that allowed in the XPath expression.
Parameters:
$document
The main document; an instance of Xacobeo::Document.
Returns TRUE if the current XPath expression is valid.
TRUE
Emmanuel Rodriguez <potyl@cpan.org>.
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.
To install Xacobeo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Xacobeo
CPAN shell
perl -MCPAN -e shell install Xacobeo
For more information on module installation, please visit the detailed CPAN module installation guide.