in reply to XML parser

to be precise; you are seeking a perl module which uses an underlying XML parser (this is usually something like expat).

as with anything, depends on what you want to do.... are you massaging data ? or are you interpreting an XML file and want to 'do' something ; if the later then you may want to use a streaming parser e.g. XML::LibXML.

Personally, I find XML::STX to be quite interesting http://www.gingerall.org/stx.html

As for converting XML to HTML, this is a different problem;

You might find using XML::LibXSLT is all you will ever need .... at the other end of the scale ... you could probably just use HTML Tidy to convert.

If you are massaging a lot of data and working in web domain, XSLT is a good route to go down.

here are some rather old links to perl and XML;

http://www.xml.com/pub/a/2000/04/05/feature/index.html
http://www.xml.com/pub/a/2001/04/18/perlxmlqstart1.html
http://www.oreillynet.com/pub/a/network/2002/07/09/perlandxml.html


hth, Jim Fuller

Replies are listed 'Best First'.
Re^2: XML parser
by hakana (Acolyte) on Nov 29, 2007 at 09:10 UTC
    The long description is that I'm making a test system. The xml file is used for both configuration and saving the results in.
    The first part is that a WEB-GUI is saving witch tests to run.
    <exec> <tc id=001></tc> <tc id=002></tc> </exec>
    Second will the testframework append testinfo to the different nodes and add childs to the nodes.
    <exec> <tc id=001 desc=first test> <ts id=001.001 result=passed/> </tc> <tc id=002 desc=second test> <ts id=002.001 result=failed/> </tc> </exec>
    So the testframework has to be able to find the specific node by using the id and append info/data and child to that node.
    Does anyone have any suggestions how to do this?
      Do you want the output file to have the same order of XML tags as the input file?

      I built an automated test equipment (ATE) configuration and test system using XML::Simple, but I didn't like it because it changed the order of the XML tags between the input and the output. I switched from XML::Simple to XML::Twig and solved this problem.

      After doing this, I thought that maybe XML is not so great for this type of application. I wanted human-readable files that were also easy to parse with a computer. I also wanted to add tags in the future without breaking old files. XML seemed like the right choice but it was not so easy to achieve these goals. Recently I have tried YAML with the same goals, but this has not been so great, either. I am still looking for a better solution.

      Now I think I should use something like YAML, but I should write my own parser.

      It should work perfectly the first time! - toma