[Xml-compile] "inheriting" toXML ?

E R pc88mxer at gmail.com
Tue Oct 23 18:30:26 GMT 2012


It seems that typemaps are used for both the Writing (hash -> xml)
phase and the Reading phase (xml -> hash).

Is there a way to modify the translation in just one of the phases?

Example:

    package mydate;

    sub fromXML { bless $_[1], $_[0] }
    # note: no toXML()

    package main;

    my $schema = ...
    $schema->addTypemap(datetime => 'mydate');

    my $call = $schema->compile_operation(...);

This fails with:

error: class mydate does not implement toXML(), required for typemap dateTime

I'd like to have toXML() just be the 'identity' function or do
whatever translation would be performed if the addTypemap() call was
never made.



More information about the Xml-compile mailing list