Hi Manuel,
The parsers used for both pull and sax based parsing are parameters to
the calls allowing you to replace the whole parser factory used.
In the case of pullXml(Resource/Completely) the parserFactoryPool
named parameter supplies the factory with the default being the fun
name DefaultStaxInputFactoryPool.
For example to add those properties define:
object CustomStaxInputFactoryPool extends
scales.utils.SimpleUnboundedPool[XMLInputFactory] { pool =>
val cdata = "
http://java.sun.com/xml/stream/properties/report-
cdata-event"
def create = {
val fac = XMLInputFactory.newInstance()
if (fac.isPropertySupported(cdata)) {
fac.setProperty(cdata, java.lang.Boolean.TRUE)
}
if
(fac.isPropertySupported(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES))
{
fac.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES,
java.lang.Boolean.FALSE)
}
if
(fac.isPropertySupported(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES))
{
fac.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES,
java.lang.Boolean.FALSE)
}
if (fac.isPropertySupported(XMLInputFactory.IS_COALESCING)) {
fac.setProperty(XMLInputFactory.IS_COALESCING,
java.lang.Boolean.FALSE)
}
fac
}
}
Then call pullXml with the pool:
pullXml( source, parserFactoryPool = CustomStaxInputFactoryPool )
You can also use this approach to customise creation of the factory
itself.
Hope that helps,
Cheers,
Chris
On May 18, 5:50 pm, Manuel Bernhardt <
bernhardt.man...@gmail.com>
wrote: