# See XML::Compile::Schema / ::WSDL / ::SOAP11 etc
Many (professional) applications process XML messages based on a formal specification, expressed in XML Schemas. XML::Compile translates between XML and Perl with the help of such schemas. Your Perl program only handles a tree of nested HASHes and ARRAYs, and does not need to understand namespaces and other general XML and schema nastiness.
Three serious WARNINGS:
For end-users, the following packages are of interest (the other are support packages):
compileClient
. However, this results in huge files, so this may
not be worth the effort.
Where other Perl modules (like SOAP::WSDL) help you using these schemas (often with a lot of run-time XPath searches), XML::Compile takes a different approach: instead of run-time processing of the specification, it will first compile the expected structure into a pure Perl CODE reference, and then use that to process the data as often as needed.
There are many Perl modules with the same intention as this one: translate between XML and nested hashes. However, there are a few serious differences: because the schema is used here (and not by the other modules), we can validate the data. XML requires validation but quite a number of modules simply ignore that.
Next to this, data-types are formatted and processed correctly; for
instance, the specification prescribes that the Integer
data-type
must accept values of at least 18 digits... not fitting in Perl's idea
of longs.
XML::Compile also supports all more complex data-types like list
,
union
, substitutionGroup
(unions on complex type level), and even
the nasty any
and anyAttribute
, which is rarely the case for the
other modules.