tksk / jing-trang

Automatically exported from code.google.com/p/jing-trang
0 stars 0 forks source link

ContentHandler.characters not called when using relaxng Validator #147

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I defined a ContentHandler class and provided it via a SAXResult object to the 
javax.xml.validation.Validator.validate method.

One of the goals for the ContentHandler was to count the number of words being 
seen. However the ContentHandler.characters method is never invoked by the 
com.thaiopensource.relaxng.jaxp.ValidatorHandlerImpl.characters method.

Any thoughts?

Thanks

Original issue reported on code.google.com by rbkca...@googlemail.com on 23 Nov 2011 at 2:47

GoogleCodeExporter commented 9 years ago
This has effectively hobbled using relaxng to validate our XML files, since we 
can't parse them without this - there's no way to get the content of a tag in 
our SAX parser.

Original comment by paik...@gmail.com on 27 Feb 2012 at 10:55

GoogleCodeExporter commented 9 years ago
As a quick hack which seems to work, I added the following code to the 
characters method of com.thaiopensource.relaxng.jaxp.ValidatorHtmlImpl:

if (contentHandler != null)
  contentHandler.characters(ch, start, length);

Original comment by rbkca...@googlemail.com on 28 Feb 2012 at 9:23