JAVA SAX DefaultHandler startCDATA() not firing

一个人想着一个人 提交于 2019-12-06 11:07:25

CDATA is a lexical event. Regular handlers (content handler, error handler) do not process these events. You need to set a lexical handler for your reader, if it supports having one. Lexical handler is a SAX2 extension so Java XMLReader uses setProperty method for setting it.

See: http://download.oracle.com/javase/6/docs/api/org/xml/sax/XMLReader.html#setProperty%28java.lang.String,%20java.lang.Object%29 and http://download.oracle.com/javase/6/docs/api/org/xml/sax/ext/LexicalHandler.html

Durandal

Is your data getting escaped in there? how are you writing the xml doc?

This may help you: How to output a CDATA section from a Sax XmlHandler

This is pretty verbose too: http://www.coderanch.com/t/127987/XML/read-cdata-sax-parser

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!