|
NAMETk::XMLViewer - Tk widget to display XMLSYNOPSISuse Tk::XMLViewer; $xmlviewer = $top->XMLViewer->pack; $xmlviewer->insertXML(-file => "test.xml"); $xmlviewer->insertXML(-text => '<?xml version="1.0" encoding="ISO-8859-1" ?><a><bla /><foo>bar</foo></a>'); DESCRIPTIONTk::XMLViewer is an widget inherited from Tk::Text which displays XML in a hierarchical tree. You can use the plus and minus buttons to hide/show parts of the tree.OPTIONS"Tk::XMLViewer" supports all option of "Tk::Text" and additionally the following:
The text tags "xml_tag", "xml_attrkey", "xml_attrval", and "xml_comment" are defined for the corresponding XML elements. If you want to customize further you can configure the tags directly, for example: $xmlviewer->tagConfigure('xml_comment', -foreground => "white", -background => "red", -font => "Helvetica 6"); METHODS
NOTESUnicodePerl/Tk 804 has Unicode support, so has "Tk::XMLViewer".Perl/Tk 800 does not support Unicode. In this case "Tk::XMLViewer" tries to translate all characters returned by the XML parser to the "iso-8859-1" charset. This may be done with a builtin function like "pack"/"unpack" or a CPAN module like Unicode::String. If no fallback could be found, then Unicode characters show as binary values. BUGSDumpXML will not work with nested text tags.There should be only one insertXML operation at one time (these is probably only an issue with threaded operations, which do not work in Perl/Tk anyway). Viewing of large XML files is slow. TODO- show to depth n: close everything from depth n+1 - create menu item "close selected region" - DTD validation (is this possible with XML::Parser?) - use alternative XML parser i.e. XML::LibXML::Reader (maybe this would be faster?) AUTHORSlaven Rezic, <slaven@rezic.de>Some additions by Jerry Geiger <jgeiger@rios.de>. SEE ALSOXML::Parser, Tk::Text, tkxmlview.
Visit the GSP FreeBSD Man Page Interface. |