Template::Plugin::XML::DOM 2.16
Sponsored Links
Template::Plugin::XML::DOM 2.16 Ranking & Summary
File size:
0.026 MB
Platform:
Any Platform
License:
GPL (GNU General Public License)
Price:
Downloads:
1199
Date added:
2006-07-14
Publisher:
Andy Wardley and Simon Matthews
Template::Plugin::XML::DOM 2.16 description
Template::Plugin::XML::DOM is a plugin interface to XML::DOM.
SYNOPSIS
# load plugin
[% USE dom = XML.DOM %]
# also provide XML::Parser options
[% USE dom = XML.DOM(ProtocolEncoding = ISO-8859-1) %]
# parse an XML file
[% doc = dom.parse(filename) %]
[% doc = dom.parse(file = filename) %]
# parse XML text
[% doc = dom.parse(xmltext) %]
[% doc = dom.parse(text = xmltext) %]
# call any XML::DOM methods on document/element nodes
[% FOREACH node = doc.getElementsByTagName(report) %]
* [% node.getAttribute(title) %] # or [% node.title %]
[% END %]
# define VIEW to present node(s)
[% VIEW report notfound=xmlstring %]
# handler block for a
...
/report>
element
[% BLOCK report %]
[% item.content(view) %]
[% END %]
# handler block for a
...
/section>
element
[% BLOCK section %]
< h1 >[% item.title %]< /h1 >
[% item.content(view) %]
[% END %]
# default template block converts item to string
[% BLOCK xmlstring; item.toString; END %]
# block to generate simple text
[% BLOCK text; item; END %]
[% END %]
# now present node (and children) via view
[% report.print(node) %]
# or print node content via view
[% node.content(report) %]
# following methods are soon to be deprecated in favour of views
[% node.toTemplate %]
[% node.childrenToTemplate %]
This is a Template Toolkit plugin interfacing to the XML::DOM module. The plugin loads the XML::DOM module and creates an XML::DOM::Parser object which is stored internally. The parse() method can then be called on the plugin to parse an XML stream into a DOM document.
[% USE dom = XML.DOM %]
[% doc = dom.parse(/tmp/myxmlfile) %]
The XML::DOM plugin object (i.e. dom in these examples) acts as a sentinel for the documents it creates (doc and any others). When the plugin object goes out of scope at the end of the current template, it will automatically call dispose() on any documents that it has created. Note that if you dispose of the the plugin object before the end of the block (i.e. by assigning a new value to the dom variable) then the documents will also be disposed at that point and should not be used thereafter.
[% USE dom = XML.DOM %]
[% doc = dom.parse(/tmp/myfile) %]
[% dom = new value %] # releases XML.DOM plugin and calls
# dispose() on doc, so dont use it!
The plugin constructor will also accept configuration options destined for the XML::Parser object:
[% USE dom = XML.DOM(ProtocolEncoding = ISO-8859-1) %]
SYNOPSIS
# load plugin
[% USE dom = XML.DOM %]
# also provide XML::Parser options
[% USE dom = XML.DOM(ProtocolEncoding = ISO-8859-1) %]
# parse an XML file
[% doc = dom.parse(filename) %]
[% doc = dom.parse(file = filename) %]
# parse XML text
[% doc = dom.parse(xmltext) %]
[% doc = dom.parse(text = xmltext) %]
# call any XML::DOM methods on document/element nodes
[% FOREACH node = doc.getElementsByTagName(report) %]
* [% node.getAttribute(title) %] # or [% node.title %]
[% END %]
# define VIEW to present node(s)
[% VIEW report notfound=xmlstring %]
# handler block for a
[% BLOCK report %]
[% item.content(view) %]
[% END %]
# handler block for a
[% BLOCK section %]
< h1 >[% item.title %]< /h1 >
[% item.content(view) %]
[% END %]
# default template block converts item to string
[% BLOCK xmlstring; item.toString; END %]
# block to generate simple text
[% BLOCK text; item; END %]
[% END %]
# now present node (and children) via view
[% report.print(node) %]
# or print node content via view
[% node.content(report) %]
# following methods are soon to be deprecated in favour of views
[% node.toTemplate %]
[% node.childrenToTemplate %]
This is a Template Toolkit plugin interfacing to the XML::DOM module. The plugin loads the XML::DOM module and creates an XML::DOM::Parser object which is stored internally. The parse() method can then be called on the plugin to parse an XML stream into a DOM document.
[% USE dom = XML.DOM %]
[% doc = dom.parse(/tmp/myxmlfile) %]
The XML::DOM plugin object (i.e. dom in these examples) acts as a sentinel for the documents it creates (doc and any others). When the plugin object goes out of scope at the end of the current template, it will automatically call dispose() on any documents that it has created. Note that if you dispose of the the plugin object before the end of the block (i.e. by assigning a new value to the dom variable) then the documents will also be disposed at that point and should not be used thereafter.
[% USE dom = XML.DOM %]
[% doc = dom.parse(/tmp/myfile) %]
[% dom = new value %] # releases XML.DOM plugin and calls
# dispose() on doc, so dont use it!
The plugin constructor will also accept configuration options destined for the XML::Parser object:
[% USE dom = XML.DOM(ProtocolEncoding = ISO-8859-1) %]
Template::Plugin::XML::DOM 2.16 Screenshot
Advertisements
Template::Plugin::XML::DOM 2.16 Keywords
XML
DOM
XML.DOM
DOM 2.16
plugin interface
interface to
%
plugin
block
doc
view
node
Template::Plugin::XML::DOM
TemplatePluginXMLDOM
Template::Plugin::XML::DOM 2.16
Libraries
Bookmark Template::Plugin::XML::DOM 2.16
Template::Plugin::XML::DOM 2.16 Copyright
WareSeeker periodically updates pricing and software information of Template::Plugin::XML::DOM 2.16 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Template::Plugin::XML::DOM 2.16 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
Related Software
Template::Plugin::XML is a XML plugin for the Template Toolkit. Free Download
Template::Plugin::XML::Simple is a plugin interface to XML::Simple. Free Download
Template::Plugin::XML::Style is a Perl module for simple XML stylesheet transformations. Free Download
Template::Plugin::Data::HTMLDumper is a template toolkit plugin interface to Data::HTMLDumper. Free Download
Template::Plugin::HtmlToText is a plugin interface to HTML::FormatText. Free Download
Template::Plugin::XML::LibXML is a XML::LibXML Template Toolkit Plugin. Free Download
Template::Plugin::JavaSQL is a Perl module to help generate Java from database schemas. Free Download
Template::Plugin::Java is a Perl module that can generate Java Classes from XML description files and templates. Free Download
Latest Software
Popular Software
Favourite Software