YenForYang has asked for the wisdom of the Perl Monks concerning the following question:
It says # FIXME this state machine wouldn't be necessary if we had a DTD.
I don't understand (not too familiar with XML::Parser, but I get the general idea of needing the handler subroutines). How would a XML DTD (because there does exist DTDs and XSDs for XML-RPC) be of any use in removing the if-elsif-else chain?
I'm trying to simplify the code for decoding XML-RPC calls/responses -- i.e. the subroutine decode. As far as I know, Frontier::RPC2 is the fastest Perl xmlrpc decoder available on CPAN, but looking at the code it looks like it code be significantly improved (?))
Side question: doe having an empty sub sub {} for the Proc handler subroutine do anything? Or can it be left out?
EDIT: To be clear, I know what a DTD is. Sorry I didn't clarify. I want to know why it would actually be useful. Because from my current understanding, wouldn't a state machine be needed regardless of the DTD? Or is there some sort of 'plug-in' for the DTD in XML::Parser I'm unaware of?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: What does this comment mean (Are DTDs of any use to XML::Parser?)
by ikegami (Patriarch) on May 02, 2018 at 22:40 UTC | |
by YenForYang (Beadle) on May 03, 2018 at 19:56 UTC | |
by ikegami (Patriarch) on May 04, 2018 at 00:38 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |