2

In this answer there's an recommendation "Use a SAX (or StAX) parser and writer at the same time.". As I understand it, it should combine e.g., a org.xml.sax.XMLReader with some XML-writer, my problem is that there seem to be many of them and none fits exactly to the XMLReader. Ideally, I'm looking for something capable of both

  • accepting the arguments as they come from startElement and endElement
  • writing an arbitrary XML-containing string

The name of the factory class for the writer is probably sufficient for me.

1 Answer 1

1

Not knowing exactly what you want to do, but have a look at David Megginsons XMLWriter: http://www.megginson.com/downloads/xml-writer-0.2.zip

It is an XMLReader and you can easily extend it to accomplish what the other answer implies: i.e use your extended XMLWriter as an XMLreader in a filetered set up.

Sign up to request clarification or add additional context in comments.

1 Comment

First I wanted something what can be fed directly with what I get from the XMLReader, then I've found out that I want to preserve the formatting... I'm afraid I'll stay with regexes. But +1 for the interesting link.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.