in reply to Generate Perl Code from XML Schema?

The reason I need a tool like this is that at work we're writing an cross platform app that stores data in XML files defined by a schema. My coworker using C# uses Xsd.exe to autogenerate his classes based on the schema, whereas I have to manually create classes that can read / write the XML files properly. Whenever there is a change to the schema my C# coworker updates his code in a matter of seconds, I have to manually go through all of my code making changes.
  • Comment on Re: Generate Perl Code from XML Schema?

Replies are listed 'Best First'.
Re: Re: Generate Perl Code from XML Schema?
by Joost (Canon) on Dec 17, 2003 at 20:17 UTC
    Depending on exactly what you want to do with the generated "code" (all I can see in your example are some accessors) and provided your XML files are reasonably small, you might be able to get away with XML::Simple. This will NOT generate code or classes from schemas, but it WILL generate a nice Perl-y datastructure from XML files.

    From the docs:

    That seems to be what you want from where I'm standing, anyway :-)

    Joost.

Re: Re: Generate Perl Code from XML Schema?
by Theo (Priest) on Dec 18, 2003 at 15:30 UTC
    Hello ayvazj. From your posts and the replies of monks more experienced that I am, I'm starting to suspect that you're not getting the answers you need in part because you are asking for information about a solution you have decided is appropriate.

    It would be better to fully describe the problem and let the skills and imagination of the monks suggest solutions. (you'll probably get more than one!)

    -theo-
    (so many nodes and so little time ... )