xml question


    Jan 15 2006 | 1:55 pm
    I need to represent the content of pattr generated XML files in a human-readable form, eg. as abulated and properly line-fed ASCII files that can be emailed and read on any computer. I guess I can write a parser in Java or Ruby, but this is going to be a fairly boring excercise, plus I have a gut feeling that I'll be reinventing the wheel. I had a look at off-the-shelf XML editors, but the Oxygen thing I found is huge, much too sophisticated and expensive.
    Anyone have tips/shortcuts/brilliant ideas?
    Best,
    Zip

    • Jan 15 2006 | 9:19 pm
      Zip,
      Converting XML to other formats is the function of XSLT, which comes bundled with oXygen. Although oXygen is large and not cheap, if you want to do this yourself, it is probably the best way of doing it. Thankfully the app comes with a free fully functional 30-day demo mode, so if you want to try it first, then you can do so at no cost.
      Just stripping markup and formatting text is one of the standard tasks in XSLT, and a recipe is given in Sal Mangano's "XSLT Cookbook", O'Reilly, ISBN 0-596-00974-7.
      XSLT also makes the trip to HTML easy if you want formatted output, and oXygen comes with some nice examples. If you want to go to PostScript or Acrobat PDF, then it gets a big harder, using FO, which is again part of oXygen. You can also go to RTF if you prefer, using free 3rd party tools.
      Howard.
      Dr Howard Oakley The Works columnist for MacUser magazine (UK) http://www.macuser.co.uk/ http://www.howardoakley.com/
    • Jan 16 2006 | 6:45 pm
      Or, you could probably grab some of the open-source xslt libraries from apache-jakarta.
      They work great, they are considered the standard of xslt implementations in the java world.
      _Mark