[Xml-compile] "inheriting" toXML ?
Mark Overmeer
mark at overmeer.net
Tue Oct 23 19:22:12 GMT 2012
* E R (pc88mxer at gmail.com) [121023 18:30]:
> 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?
> 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.
Hm. I can imagin the need. On the other hand, I think the error
message is very helpfull, detecting problems at compile-time.
I could add an option to disable the error on demand. Disable all
checking or disable fromXML() and disable toXML() checking. Something
like:
typemap_check => NONE fromXML toXML ALL (default)
Or, you could base all your types of some base-class (very common to
have such in OO structures) which implements the identity toXML().
--
Regards,
MarkOv
------------------------------------------------------------------------
Mark Overmeer MSc MARKOV Solutions
Mark at Overmeer.net solutions at overmeer.net
http://Mark.Overmeer.net http://solutions.overmeer.net
More information about the Xml-compile
mailing list