Hi Thiwanka,

You're on the right track. The asynchronous version of the LSParser could
probably be implemented as an extension of DOMParserImpl. You'll find
details about EventListeners and EventTargets in the DOM Level 2 Events [1]
specification. You may get some ideas for the design by having a look at
Xerces DOM implementation. org.apache.xerces.dom.NodeImpl and
org.apache.xerces.dom.DocumentImpl have methods relevant to event
processing. The Events currently implemented by Xerces are located under
org.apache.xerces.dom.events.*. You could extend the base EventImpl class
for supporting LSProgressEvent and LSLoadEvent.

Once you've had a look at that we can talk more about parseWithContext.

Thanks.

[1]
http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-Registration-interfaces

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [email protected]
E-mail: [email protected]

Thiwanka Somasiri <[email protected]> wrote on 02/09/2011 11:33:45 AM:

> Hi Michael,
>              I read the functional details on [1] [2] and went
> through the last year student's discussion [3] about the
> "Asynchronous LSParser and parseWithContext" project. As I
> understood by referring these materials, still there are two things
> to be completed.
>
>             1. Implement asynchronous version LSParser (where
>  boolean async is "true" or asynchronous mode enabled)
>             2. Implement the parseWithContext functionality in
DOMParserImpl
>
> According the W3C recommendation LSParser objects (DOMParserImpl in
> this case) are expected to implement EventTarget interface [1] to
> make event listeners registered in asynchronous mode of LSparser. As
> I understood, implementation of the Asynchronous version will also
> influence the return values of the "parse" and "parseURI" methods,
> since the return values of them as the LSParser is in Asynchronous
> mode should be "null". This is because of the Document object is not
> still be constructed when this method returns.
>
> Implementing parseWithContext function will give support to parse a
> fragment of an XML document through LSInput into an existing
> document in a specified position according to the arguments passed
> with the method itself which needs more attention (as I guess)
> because the inserting source document is a fragment of an XML
> document [2] (ie anything except a complete XML document).
>
> At the moment I am studying about these two strategies in an
> implementation perspective and studying the LSParser related classes
> such as DOMParserImpl, AbstractDOMParser, etc as you suggested. I am
> also trying to cover the area for EventTarget, EventListeners stuff
> (which I think may important for future work) to create a proper
> background for the project. So can you tell me where I can find
> materials to study EventListeners and other critical areas needed?
>
> This is the brief idea I have got at the moment. So I hope your
> advice to guide me to go somewhat deeper from where I am at the moment.
>
> [1] http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-
> save.html#LS-LSParser
> [2] http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-
> save.html#LS-LSParser-parseWithContext
> [3] http://markmail.org/thread/ool7dyyzffor6o7b
>
> Thanks.
>
> On Tue, Feb 8, 2011 at 12:04 AM, Michael Glavassevich
<[email protected]
> > wrote:
> Hi Thiwanka,
>
> You'll find the functional details [1][2] in the DOM Level 3 Load
> and Save specification. From an implementation perspective I would
> suggest familiarizing yourself with the classes in Xerces which
> compose the LSParser (e.g. XMLDocumentFragmentScannerImpl,
> XMLDocumentScannerImpl, AbstractDOMParser, DOMParserImpl, etc...).
>
> There's a discussion [3] from last year with a student who was
> considering doing this project that you might also find informative.
>
> Thanks.
>
> [1] http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-
> save.html#LS-LSParser
> [2] http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-
> save.html#LS-LSParser-parseWithContext
> [3] http://markmail.org/thread/ool7dyyzffor6o7b
>
>
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: [email protected]
> E-mail: [email protected]

> Thiwanka Somasiri <[email protected]> wrote on 02/06/2011 11:18:46 PM:
>
> > Hi Michael,
>
> >                  First thank you for your reply. Now I am getting
> > familiar to Apache Xerces little by little according to your steps
> > in the first reply. Can you guide me to the specific areas that I
> > should refer to create a proper background to the "Asynchronous
> > LSParser and parseWithContext" project.
> >
> > Thanks.
>
> > On Sun, Feb 6, 2011 at 10:35 PM, Michael Glavassevich
<[email protected]
> > > wrote:
> > Hi Thiwanka,
> >
> > Thiwanka Somasiri <[email protected]> wrote on 02/05/2011 11:53:36
PM:
> >
> > > Hi Michael,
> >
> > >           I started to follow the steps you have asked me to study.
> > > Also I noticed the GSoC project ideas list in 2009 and some of them
> > > were done in 2009 and 2010. As I saw the "Asynchronous LSParser and
> > > parseWithContext" project is not done as a GSoC project yet. Is this
> > > project available now? If so, can I attempt to do this project
> forGSoC 2011?
>
> > Yes, this project would still be available for 2011. We may also
> > brainstorm some new project ideas and post those as well.
> >
> > It's still fairly early. GSoC 2011 was only announced a few weeks
> > ago. Apache is just starting [1] to work out the logistics for this
> > year. We may use JIRA again for posting ideas, though the admins may
> > agree that we should be using something else (e.g. going back to
> Wikis again).
> >
> > > Thanks.
> >
> > Thanks.
> >
> > [1] http://markmail.org/message/hhvszpjotnkmjxcv
> >
> >
> > Michael Glavassevich
> > XML Parser Development
> > IBM Toronto Lab
> > E-mail: [email protected]
> > E-mail: [email protected]
> >
> >
> >
> > --
> >
> > Regards
> >
> > A.S.Thiwanka Somasiri
> >
> > Skype : executionerwild
> > MSN   : [email protected]
>
>
>
> --
>
> Regards
>
> A.S.Thiwanka Somasiri
>
> Skype : executionerwild
> MSN   : [email protected]

Reply via email to