Andy Clark wrote:

> The call to setFeature will not be ignored. The XNI Manual
> in the documentation states:
>
>   Before parsing a document, a parser configuration must use
>   the component manager to reset all of the parser components.
>   Then, during parsing, each time a feature or property value
>   is modified, all of the components must be informed of the
>   change. [1]
>
> Note the second part which says that during a parse, calls
> to XMLParserConfiguration#setFeature or #setProperty are
> forwarded to all registered components that implement the
> XMLComponent interface. In this way, configurable components
> are notified of changes to the configuration settings.
>
> This behavior does not change if the parser configuration
> implements the XMLPullParserConfiguration interface (which
> extends the XMLParserConfiguration interface).

hi,

interesting information however it seems that time between setInputSource
and parse(false) in XMLPullParserConfiguration is a "black hole" -
parse(false) does not take into account anything that happened after
setInputSource.

for example take org.apache.xerces.impl.XMLDocumentScannerImpl:

    public void reset(XMLComponentManager componentManager)
        throws XMLConfigurationException {

        super.reset(componentManager);

        // other settings
        fDocumentSystemId = null;
        fDoctypeName = null;
        fDoctypePublicId = null;
        fDoctypeSystemId = null;

        // sax features
        try {
            fNamespaces = componentManager.getFeature(NAMESPACES);
        }
        catch (XMLConfigurationException e) {
            fNamespaces = true;
        }
        fAttributes.setNamespaces(fNamespaces);

as you can see fNamespaces is only set when reset(...) is called. that
happens in setInputSource(..) as expected however parse(false) in
XMLPullParserConfiguration is not calling reset :-(

possible solution would be to set dirtyBeforeParsding flag when
setFeature() and make parse(false) to chekc flag and call reset()

if necessary i can extract some sample code to demonstrate this behavior.

thanks,

alek


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to