[
https://issues.apache.org/jira/browse/XERCESJ-1259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12519589
]
Michael Glavassevich commented on XERCESJ-1259:
-----------------------------------------------
Wei, I finally found some time to take a deeper look at your patch. Here are
some comments on the StreamFilter support and implementation of close().
Regarding StAXFilterParser:
- when a filtered XMLStreamReader is created it should be sitting on the first
event which the StreamFilter accepts; in other words in the constructor you
should be invoking the filter
- your implementations of next() and hasNext() recursively call themselves in
an endless loop. think you probably meant super.next() and super.hasNext().
- hasNext() shouldn't advance the XMLStreamReader. It's just checking if
there's more input; you probably don't need to override this method.
- next() should pass the next event to the StreamFilter instead of the current
one and stop at END_DOCUMENT instead of letting it run passed the end which
would result in a XMLStreamException (if you try to advance the underlying
XMLStreamReader any further)
- think you also need to override nextTag() so that it also uses the
StreamFilter
Regarding close(), I see that the implementation is currently calling cleanup()
on the XMLParserConfiguration. I think what we really need here is to recycle
the XMLParserConfiguration so that it can be reused by a new XMLStreamReader
returned from the XMLInputFactory. This would be pretty important for
performance when reading small documents since creating an
XMLParserConfiguration is rather expensive.
> Add SteamFilter Function to SoC2007 project "Add support for the StAX
> (JSR-173) cursor API to Xerces-J"
> -------------------------------------------------------------------------------------------------------
>
> Key: XERCESJ-1259
> URL: https://issues.apache.org/jira/browse/XERCESJ-1259
> Project: Xerces2-J
> Issue Type: New Feature
> Components: StAX
> Affects Versions: 2.9.0
> Reporter: Wei Duan
> Assignee: Michael Glavassevich
> Attachments: patch_7.8.txt
>
>
> The change adds more funtionalities to the StAX support, include
> 1. Add StreamFilter support.
> 2. Add full support for Entity Referrence, and add support for DTD and CDATA.
> 3. Implment the close() method in XMLStreamReader implementation.
> The plan for next two weeks will include,
> 1. Add support for properties such as XMLReporter, XMLResolver, etc.
> 2. Upload the unit test cases to SVN server, currently on my local machine.
> 3. Refine current code according to feedback from Michael.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]