Hi Guys, Gals,
I will be releasing Version 1 of my XMLi opensource software in the next week and I'm pretty keen to see if any of you guys would be willing to give it a quick run through. It comes with over 20 example programs, with supporting XMLi templates. It will run on a V5R4+ version of the OS. I will be spending the next few days trying to get the supporting docs fully updated! If would like to test this for me please contact me off-list and I will send over a zip file with everything you need - including the docs as they currently stand.
*** What does XMLi do..? ***
Basically, XMLi is a tool that allows you to build xml within you RPG program by either:
1 - Building it node-by-node.
2 - Writing an XML template and running it via the xmli_runTemplate() procedure or by calling the RUNXMLI command. The XML template is an XML document that contains your static XML plus any SQL queries, template variables, assignments, loops, ifs, etc. You can define variables within the template and set/amend them, populate them from SQL queries, from parameters passed to the template, or from other variables. You can import other templates to keep common code in one place. Essentially it is a XML-based language that builds XML - all run in RPG. You can write your XML to a file, pass it to standard output, pass it to a handler procedure. You can write your own custom SRVPGM extensions and extend the language - allowing you to read and/or populate template variables, you can control loops from within your extension. The extensions are linked by adding them to the xmli_config.xml file! They are bound at runtime.
Following the release of the Beta in February I have added a LOT to it, and work is still progressing. I have been working on the product to
expand its capabilities and make it run even faster.
A summary of
the V1 changes are listed below. The most important additions are the
ability to load and run up to 256 templates, the new looping (do-while,
do-until, for) constructs, and by far the most significant, the ability
for a developer to create his/her own plug-ins to extend the XMLi
language. I have created a couple of demo plug-ins to demonstrate - the string plug-in converts the case of the enclosed XML, variable, or parameter value, the math plug-in allows
you to do math in your XML!
Here is a list of the XMLi
templating changes so far:
1) Added support for loading and
switching between up to 256 template definitions
2) Added ability to
pass template name and up to 64 parameters on call to xmli_runTemplate()
3)
Added <xmli:include /> element to allow the include of static xml
from a stream file to the template
4) Added <xmli:escape-markup
/> element to allow the markup of all output xml within this element
to be escaped with entity references
5) Added 4 new xml output
formats.
6) <xmli:call-handler /> now includes a reset
attribute to condition whether to reset the current offset in the memory
space back to 0
7) <xmli:write-to-file /> now includes a reset
attribute to condition whether to reset the current offset in the
memory space back to 0
8) Added <xmli:write-to-stdout />
element to allow writing to standard output. This includes a reset
attribute, as above
9) Fixed issue with variable data allocation to
allow values to be correctly set for variables at run-time
10) Fixed
issue with pre-defined static entity references not transposing to
output xml correctly
11) Refactored element data parsing code to make
it more efficient
12) Re-engineered the storage of template static
resource to considerably enhance runtime performance, and allow for more
efficient building of multiple template resources
13) Added
<xmli:do-while> looping construct
14) Added
<xmli:do-until> looping construct
15) Added <xmli:for>
looping construct
16) Enhanced <xmli:leave /> and <xmli:iter
/> to support leaving the three new looping constructs in addition
to the <xmli:for-each> SQL Result Set looping construct
17)
*** ADDED ABILITY TO PLUG IN XMLI EXTENSIONS ***
- This
capability allows the RPG developer to extend the xmli language by
writing simple extensions and plugging them in
- A new
configuration file (xmli_config.xml) includes references to the names
and locations of the extensions and any pre-load templates
- Extensions are loaded/activated
at runtime, no binding is required at compile time
- Only
extensions referenced in a running xmli template will be
loaded/activated - they are NOT activated when the config is loaded
(Note: If the core="true" attribute is set for an extension it is included as part of the core XMLi product and will be loaded at config time)
- XMLi currently supports the registration (and concurrent use) of up
to 256 extensions
- Assignment of variable values enhanced to
support value assignment from operations via XMLi Extensions
-
Generation of output values enhanced to support value assignment from
operations via XMLi Extensions
- Extensions can inter-operate.
Nesting of extension elements is fully supported
- Ability to include templates within the XMLi config file to pre-load templates on config load. This allows the pre-loading of up to 256 templates.
18) *** New xmli
XSD Schema Created ***
- The xmli.xsd schema can be used to
validate the xmli template
- The xmli.xsd schema can be used to
provide Content Assist when working in a suitable IDE such as RDi
(Content Assist and in-line validation can be achieved in RDi by
adding the schema to the RDi XML Catalog)
19) Modified the xmli
template root tag to be written as either <xmli-template>
(original) or <xmli:template> (preferred)
- The new root
tag name <xmli:template> is required for the xmli.xsd schema
validation and Content Assist to work within RDi
as the schema
requires the root to be within the xmli namespace
20) A
new RUNXMLI command has been included - this allows the ability to run a
xmli template from the command line or within a CL program.
-
The command takes a template location and up to 64 template parameters
My
goal is to continue to build the XMLi language framework to easily plug
in any other open source offerings and allow them to work together. You
could conceivably write XML to build a SOAP envelope, call a web service and pass the SOAP request using HTTPAPI, retrieve the XML
response and write it to a stream file, decompose it, or even attach it to an email
and send it using MMAIL or RPG Mail. The list of recipient email
addresses could be retrieved via a SQL query! The framework supports all
of this via plug-in extensions - relatively simple service programs
that translate XML elements into sub-procedure calls. Its quite exciting
and really easy to write the plug in code! Another easy use is to serve XHTML web pages via the integrated web server and use SQL or call your RPG logic via an extension.
If you are interested in giving this a go please contact me off-list. If not, it will be released very soon so you can download the GA version then. I'll fire a post when it is on sourceforge for those who would rather wait for the GA version.
Thanks in advance!
Cheers
Larry Ducie
_________________________________________________________________
If It Exists, You'll Find it on SEEK. Australia's #1 job site
http://clk.atdmt.com/NMN/go/157639755/direct/01/
As an Amazon Associate we earn from qualifying purchases.