[ 
https://issues.apache.org/jira/browse/XERCESJ-1259?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Wei Duan updated XERCESJ-1259:
------------------------------

    Attachment: patch_8.18.zip

Hi Michael, thanks for your review comments. This patch includes

1)  XMLResolver and XMLReporter implementation 
2)  Code Improvement according to  your review comments.  

My response for your comments: 

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

[Wei : Add next() in the constructor]

- your implementations of next() and hasNext() recursively call themselves in 
an endless loop. think you probably meant super.next() and super.hasNext().

[Wei: Modified, use super.next() or super.hasnext() instead. ]

- hasNext() shouldn't advance the XMLStreamReader. It's just checking if 
there's more input; you probably don't need to override this method.

[Wei: Remove hasNext(). ]

- 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)

[Wei: Yes, modify previous implementation.  ]

- think you also need to override nextTag() so that it also uses the 
StreamFilter

[Wei: Override nextTag() ]

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.

[Wei: Add two functions 1) public void InitStAXParser(XML11Configuration 
config) 2 )  public XML11Configuration GetXMLConfiguration(). So the other 
paser can share the configuration instance.]

This patch aslo include EntityResolve and Reporter implementation. Since my 
machine has some problem to patch newly added files. So I add the two new files 
into the zip. 

Thanks, Wei.  


> 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, patch_8.18.zip
>
>
> 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]

Reply via email to