Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

There's a lot of xml out there, and diffing it against canned data has helped me in the past.

But there's a few things I find I need to do:

  • Delete segments of the xml I don't care about (timestamps)
  • Sort certain xpaths by some key (a relative child xpath)
  • Indent and 'Normalise' the xml =

I've written this a few times at various companies. Is there something out there in the open source world we can use to avoid me writing it again at the next company?

Also, what are your experiences with testing xml?

share|improve this question
    
I bet there's a million XML beautifiers out there :) –  corsiKa Jul 7 '11 at 22:47
    
Nothing except for the last sentence of your question is specific to testing. While there is nothing wrong with posting your question here, you may find more answers in a different forum, e.g. StackOverflow. –  user246 Jul 10 '11 at 19:16
    
If you have written it a few times why don't you write an open source an implementation, chuck it on google code/github/whereever and just grab it each time you use it? The more you use it the more mature and stable it gets and it can be reused every time you get a new gig. Finally others get to enjoy it as well. –  Ardesco Jul 12 '11 at 10:40
add comment

3 Answers

If you've written it yourself, why don't you keep a copy of it for yourself and just add it to your toolkit wherever you go? It would probably be more robust and extensible than any other solution.

share|improve this answer
    
Sorry - I'm a stickler - Would have to be from memory. I try and keep above board regarding copyright. –  Squirrel Jul 9 '11 at 5:57
add comment

One example of software that could be used for xml testing:

http://xmlstar.sourceforge.net/

I think the only thing missing is being able to sort an xpath based on a child xpath.

E.g.

<xml>
      <b key="bee"></b>
      <a key="apple"></a>
<xml>

I'd like to sort /xml/* using ./@key

share|improve this answer
add comment

If you are willing to use Lisp, I suggest looking at the XML parsing and writing functions in Clojure.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.