NAME

XML::Compile - Compilation based XML processing

SYNOPSIS

# See XML::Compile::Schema

DESCRIPTION

Many applications which process XML do that based on a nice specification, expressed in an XML Schema. XML::Compile reads and writes XML data with the help of schema's. On the Perl side, it uses a tree of nested hashes with the same structure.

Where other Perl modules, like SOAP::WSDL help you using these schema's with a lot of XPath searches, this module takes a different approach: in stead of a run-time processing of the specification, it will first compile the expected structure into real Perl, and then use that to process the data.

There are many perl modules which do the same: translate between XML and hashes. However, there are a few serious differences: because the schema is used here, we make sure we only handle correct data. Furthermore, data-types like Integer do accept huge values as the specification prescribes. Also more complex data-types like list and union are correctly supported.

METHODS

Constructors

$obj->new(TOP, OPTIONS)

    The TOP is a XML::LibXML::Document (a direct result from parsing activities) or a XML::LibXML::Node (a sub-tree). In any case, a product of the XML::LibXML module (based on libxml2).

    If you have compiled/collected all the information you need, then simply terminate the compiler object: that will clean-up the XML::LibXML objects.

Accessors

$obj->top

    Returns the XML::LibXML object tree which needs to be compiled.

Filters

$obj->walkTree(NODE, CODE)

    Walks the whole tree from NODE downwards, calling the CODE reference for each NODE found. When the routine returns false, the child nodes will be skipped.

Compilers

REFERENCES

See the XML::Compile website at http://perl.overmeer.net/xml-compile/ for more details.

COPYRIGHTS

Module version 0.01. Written by Mark Overmeer (mark@overmeer.net). See the ChangeLog for other contributors.

Copyright (c) 2006 by the author(s). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.