开发者

Java XML-replace using org.xml.sax.XMLReader

开发者 https://www.devze.com 2023-04-06 10:59 出处:网络
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 prob

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 somet开发者_如何学编程hing 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消