Xacobeo::UI::XPathEntry(3) XPath text entry

SYNOPSIS


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);
}

DESCRIPTION

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.

PROPERTIES

The following properties are defined:

document

The document being displayed.

valid

Indicates if the XPath expression beind displayed is valid based on the current document.

METHODS

The following methods are available:

new

Creates a new instance. This is simply the parent's constructor.

set_document

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.

is_valid

Returns "TRUE" if the current XPath expression is valid.

AUTHORS

Emmanuel Rodriguez <[email protected]>.

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.