Right now, the few web services we have all create their XML output using XML::Simple. This is not the fastest parser in the world, so I've been looking to minimize/remove it's usage. Looking at it in /svc got me thinking: perhaps we should be using T:T to generate our web services output instead. This would have all the advantages of T:T, and allow us to reuse common portions text. I think the templates would live in koha-tmpl/svc-tmpl/prog/en. From there, we could break down by output language (XML, JSON, etc), so our web services could be fully customizable in terms of output format (without having to reinvent the script, or provide long nasty if/elsif conditionals). If we put this in place now for the few /svc scripts we have, it would be a good test for the practicality of this, and if it works, could be a practice to continue forward (with several working examples). Thoughts? -Ian
Op 11-04-12 23:31, Ian Walls schreef:
Right now, the few web services we have all create their XML output using XML::Simple. This is not the fastest parser in the world, so I've been looking to minimize/remove it's usage.
I work with the maintainer of XML::Simple. I'm quite sure he wouldn't object to me putting these words in his mouth: "Don't use XML::Simple, move to something that does things properly. It's deprecated and a bad idea outside of a very narrow set of circumstances." That's pretty much his advice whenever anyone brings it up.
Looking at it in /svc got me thinking: perhaps we should be using T:T to generate our web services output instead. This would have all the advantages of T:T, and allow us to reuse common portions text.
I've done this for something else, and it's not super-great compared to a real XML system, but it does work and works fairly well. Also, it's very easy. http://template-toolkit.org/docs/tutorial/Datafile.html#section_Producing_XM... I don't see it there, but you could make a default filter that encoded everything to XML entities. Robin.
C4/ILSDI/Services.pm also uses XML::Simple to do output. Strings are actually composed in the subroutines, making any changes to the schema a C4-editing patch. Having an ILSDI template directory would serve us much better here, I think. -Ian 2012/4/11 Robin Sheat <robin@catalyst.net.nz>
Op 11-04-12 23:31, Ian Walls schreef:
Right now, the few web services we have all create their XML output using XML::Simple. This is not the fastest parser in the world, so I've been looking to minimize/remove it's usage.
I work with the maintainer of XML::Simple. I'm quite sure he wouldn't object to me putting these words in his mouth: "Don't use XML::Simple, move to something that does things properly. It's deprecated and a bad idea outside of a very narrow set of circumstances."
That's pretty much his advice whenever anyone brings it up.
Looking at it in /svc got me thinking: perhaps we should be using T:T to generate our web services output instead. This would have all the advantages of T:T, and allow us to reuse common portions text.
I've done this for something else, and it's not super-great compared to a real XML system, but it does work and works fairly well. Also, it's very easy.
http://template-toolkit.org/docs/tutorial/Datafile.html#section_Producing_XM...
I don't see it there, but you could make a default filter that encoded everything to XML entities.
Robin.
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
...and the other places with XMLout are patron and item card creation, and the Syndetics external service. Dealing with those places another way would reduce our dependency on XML::Simple by about half. -Ian On Wed, Apr 11, 2012 at 13:15, Ian Walls <koha.sekjal@gmail.com> wrote:
C4/ILSDI/Services.pm also uses XML::Simple to do output. Strings are actually composed in the subroutines, making any changes to the schema a C4-editing patch. Having an ILSDI template directory would serve us much better here, I think.
-Ian
2012/4/11 Robin Sheat <robin@catalyst.net.nz>
Op 11-04-12 23:31, Ian Walls schreef:
Right now, the few web services we have all create their XML output using XML::Simple. This is not the fastest parser in the world, so I've been looking to minimize/remove it's usage.
I work with the maintainer of XML::Simple. I'm quite sure he wouldn't object to me putting these words in his mouth: "Don't use XML::Simple, move to something that does things properly. It's deprecated and a bad idea outside of a very narrow set of circumstances."
That's pretty much his advice whenever anyone brings it up.
Looking at it in /svc got me thinking: perhaps we should be using T:T to generate our web services output instead. This would have all the advantages of T:T, and allow us to reuse common portions text.
I've done this for something else, and it's not super-great compared to a real XML system, but it does work and works fairly well. Also, it's very easy.
http://template-toolkit.org/docs/tutorial/Datafile.html#section_Producing_XM...
I don't see it there, but you could make a default filter that encoded everything to XML entities.
Robin.
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
participants (2)
-
Ian Walls -
Robin Sheat