1

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.

Community
  • 1
  • 1
maaartinus
  • 44,714
  • 32
  • 161
  • 320

1 Answers1

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.

forty-two
  • 12,204
  • 2
  • 26
  • 36
  • 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. – maaartinus Sep 19 '11 at 20:46