You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Thiwanka Somasiri <as...@gmail.com> on 2011/02/05 18:12:48 UTC

New to Apcahe Xerces

Hi,

   I am new to Apache Xerces and I am willing to contribute to the project.
Can someone tell me where to start to move forward? And I am interested in
Xerces2 Java Parser.

thanks.

-- 

Regards

A.S.Thiwanka Somasiri

Skype : executionerwild
MSN   : thiwas@ymail.com
<th...@ymail.com>

Re: New to Apcahe Xerces

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Hi Thiwanka,

Congratulations to you as well and welcome aboard.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Thiwanka Somasiri <as...@gmail.com> wrote on 04/25/2011 09:12:06 PM:

> Hi Michaeal and devs,
>
>               I am pretty happy to say that I have selected for this
> Googls Summer under "Asynchronous LSParser and parseWithContext()"
> project. I want to make this an opportunity to thank Michael and all
> other devs in the community for helping me to go through this stage
> of the project successfully . All the credit goes to you for
> creating such a good background for freshers like us to come and
> play, and I will do my maximum to complete this project and to give
> a valued contribution to Apache Xerces2-J.
>
> Thanks.
>

> On Wed, Apr 6, 2011 at 8:44 PM, Michael Glavassevich <mrglavas@ca.ibm.com
> > wrote:
> Hi Thiwanka,
>
> I've reviewed your revised proposal. Your updates are good.
>
>
> Thanks.
>
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org

> Thiwanka Somasiri <as...@gmail.com> wrote on 04/05/2011 05:58:42 PM:
>
> > Hi Michael,
>
> >
> >         Thank you for reviewing my proposal and giving me valuable
> > feedbacks. There were some points that I have misunderstood and I
> > corrected them in the proposal. I have attached the modified
> > proposal in this mail and highlighted the newly added/altered areas
> > in the PDF for your convenience. I will enter the proposal in the
> > GSoC tool and I am grateful to you if you can skim through it and
> > check whether there are misunderstood points.
> >
> > Thanks you very much for your guidance & support.
>
> > On Tue, Apr 5, 2011 at 11:40 PM, Michael Glavassevich
<mrglavas@ca.ibm.com
> > > wrote:
> > Hi Thiwanka,
> >
> > I've just reviewed your proposal. Looks good overall, but I have a
> > few suggestions for improvement:
> >
> > For the asynchronous LSParser it would be good if you mentioned
> > something about how the main thread and the 2nd thread that the
> > parser runs on interact, specifically your thoughts on updating the
> > LSParser's 'busy' state and how a call to abort() would terminate
> > the parsing thread if it hadn't completed yet.
> >
> > The return value of dispatchEvent() is determined to be true/false
> > based on whether preventDefault() was called on the Event by an
> > EventListener, not on whether an EventListener could "handle" the
> > event. It would be good if you would correct that.
> >
> > There's a typo in the parseWithContext() section. I'm sure you meant
> > "<ns2:c/><ns1:d/>" (two empty-tags) instead of "</ns2:c></ns1:d>"
> > (two unpaired end-tags).
> >
> > In the last section on parseWithContext() you seem to be implying
> > that a Document node (as the context node) with an action of
> > ACTION_REPLACE_CHILDREN is an error condition. When I said it was an
> > exception, I meant it was an exceptional case that needed to be
> > handled differently than the other inputs. It's not an error, but is
> > the one case where a whole XML document is expected instead of a
> > fragment. More detail in my previous reply below.
> >
> > Once you're ready feel free to enter your proposal into the GSoC tool.
> >
> > Great work!
> >
> >
> > Thanks.
> >
> > Michael Glavassevich
> > XML Parser Development
> > IBM Toronto Lab
> > E-mail: mrglavas@ca.ibm.com
> > E-mail: mrglavas@apache.org
>
> > Thiwanka Somasiri <as...@gmail.com> wrote on 04/05/2011 12:43:32
AM:
> >
> > > Hi Michael and devs,
> >
> > >
> > >       As per discussion with Michael Glavassevich about the
> > > "Asynchronous LSParser and parseWithContext()" GSoC project
> > under XERCESJ-1429
> > > , I have prepared my proposal and attached it to this mail. I would
> > > like to know whether I should improve the proposal and if so which
> > > areas should be improved in it. Hope you feedbacks soon since the
> > > deadline is on 8th of April.
> > >
> > > P.S. - Michael, I have included you as the mentor for the project.
> > >
> > > Thanks.
> > >
> > > On Fri, Apr 1, 2011 at 9:58 AM, Michael Glavassevich
<mrglavas@ca.ibm.com
> > > > wrote:
> > > Hi Thiwanka,
> > >
> > > Thiwanka Somasiri <as...@gmail.com> wrote on 03/31/2011 08:21:55
AM:
> > >
> > > > Hi Michael,
> > >
> > > >
> > > >                  By using a synthesized wrapper XML document, does
> > > > it mean to convert the fragment to a temporary complete XML
document
> > > > (using a dummy root - so it can be parsed like a normal XML
> > > > document), parse it and merge the nodes created with this to the
> > > > existing document? If so, whenever the fragment contains an
> > > > erroneous point, an exception will be thrown. Otherwise we can
> > > > extract the relevant nodes to the XML fragment (removing dummy root

> > > > nodes) and add them to the existing document.
> >
> > > Right, that's what I meant, though you're not really 'converting'
> > > the fragment, but including it by reference in a dummy wrapper XML
> > > document so that it can be parsed like any other XML document. The
> > > one exception is when the context node is a Document node and the
> > > action is ACTION_REPLACE_CHILDREN. You would process the input as a
> > > whole XML document, very similar to if the input was parsed using
> > > the regular LSParser.parse() method.
> > >
> > >
> > > > I have attached an image(http://img145.imageshack.us/i/
> > > > xmlfragmentinsertion.png/) describing what I understood from you
> > > > previous reply. If I have misunderstood that, please correct me.
> >
> > > Your diagram illustrates the idea quite well.
> > >
> > >
> > > > I am looking for your advices to start with my proposal. I want to
> > > > know what are the key point that should be included and is it
enough
> > > > to have high level implementation details in the proposal?
> >
> > > Your proposal should include a high level design for the
> > > asynchronous mode for the LSParser and parseWithContext(), as well
> > > as details on your thoughts for implementation. It should include a
> > > plan/timeline for the work you would be doing, some details about
> > > yourself and your development experience, details about the
> > > interaction that you've had with the community and also say
> > > something about the time you would be able to commit to the project
> > > over the summer. Proposals from 2010 are up on the Xerces Wiki (
> > > http://wiki.apache.org/xerces/FrontPage). You may want to take a
> > > look at them to get a better idea of the structure and level of
> > > detail in a successful GSoC proposal.
> > >
> > >
> > > > Thanks.
> > > >
> > > > On Thu, Mar 31, 2011 at 10:40 AM, Michael Glavassevich <
> > mrglavas@ca.ibm.com
> > > > > wrote:
> > > > Hi Thiwanka,
> > > >
> > > > Aside from the previous discussion on the mailing list [1] and the
> > > > specification I'm not aware of any good reading material on
> > > > parseWithContext().
> > > >
> > > > I have given the design more thought since last year and think it
> > > > should be possible to implement this method (in the case where the
> > > > context node is not a Document node) by synthesizing a wrapper XML
> > > > document which contains a reference to the fragment and the
> > > > necessary context (e.g. namespace declarations) required to parse
> > > > the fragment. You can then transfer the nodes created for the
> > > > fragment into the existing DOM.
> > > >
> > > > For example, if your existing document looked like this:
> > > >
> > > > <ns1:a xmlns:ns1="http://ns1">
> > > >  <ns2:b xmlns:ns2="http://ns2"/>
> > > > </ns1:a>
> > > >
> > > > and you wanted to insert an XML fragment like:
> > > >
> > > > <ns2:c/><ns1:d/>
> > > >
> > > > as a child of 'ns2:b', you could generate a wrapper document:
> > > >
> > > > <!DOCTYPE DUMMY_ROOT [
> > > >  <!ENTITY fragment PUBLIC "***" "***">
> > > > ]>
> > > > <DUMMY_ROOT xmlns:ns1="http://ns1" xmlns:ns2="http://ns2
> > > > ">&fragment;</DUMMY_ROOT>
> > > >
> > > > where the 'fragment' entity points to the XML fragment the user
> > > > provided, parse the document you synthesized and then move the
nodes
> > > > created underneath the entity reference into the existing document,

> > > > resulting in:
> > > >
> > > > <ns1:a xmlns:ns1="http://ns1">
> > > >  <ns2:b xmlns:ns2="http://ns2"><ns2:c/><ns1:d/></ns2:b>
> > > > </ns1:a>
> > > >
> > > > Hope that made sense.
> > > >
> > > > Thanks.
> > > >
> > > > [1] http://markmail.org/thread/ool7dyyzffor6o7b
> > > >
> > > >
> > > > Michael Glavassevich
> > > > XML Parser Development
> > > > IBM Toronto Lab
> > > > E-mail: mrglavas@ca.ibm.com
> > > > E-mail: mrglavas@apache.org
> > >
> > > > Thiwanka Somasiri <as...@gmail.com> wrote on 03/28/2011
> 02:05:24 PM:
> > > >
> > > > > Hi Michael,
> > > >
> > > > >
> > > > > As I understood, the second part of the project is also a
critical
> > > > > implementation, which is known as parseWithContext(). According
to
> > > > > the W3C specification[1], this method is used to insert a
fragment
> > > > > of and XML document to an existing document. The parameters in
the
> > > > > method specify the position where the new fragment should be
> > > > > attached and which action should be triggered between the
existing
> > > > > document and the new fragment.
> > > > >
> > > > > The implementation also include an error handling part (in a case

> > > > > where the inserting fragment is erroneous,etc) to notify the
caller
> > > > > through an ErrorHandler object when an unexpected scenario occur.
> > > > >
> > > > > I need to understand the background for parseWithContext() some
more
> > > > > and can you tell me what are the useful resources in this regard.

> > > > > (Understanding the overall idea of this will help me to allocate
> > > > > approximate time in the proposal)
> > > > >
> > > > > I would like to start writing a proposal for the project and I
need
> > > > > a big help from you. I am happy if you can give me an starting
point
> > > > > and guide lines to write the proposal.
> > > > >
> > > > > [1] http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-
> > > > > save.html#LS-LSParser-parseWithContext
> > > > >
> > > > > Thanks.
> > > > >
> > > > > On Sat, Mar 19, 2011 at 11:41 PM, Michael Glavassevich <
> > > mrglavas@ca.ibm.com
> > > > > > wrote:
> > > > > Hi Thiwanka,
> > > > >
> > > > > Thiwanka Somasiri <as...@gmail.com> wrote on 03/19/2011
> > 02:25:03 AM:
> > > > >
> > > > > > Hi Michael,
> > > > >
> > > > > >
> > > > > >     Thanks for your reply. I will study more on the project
within
> > > > > > next week and come up with both my issues and ideas. Since I
was
> > > > > > having my exams, I could not focus much on the project and will
be
> > > > > > free after few more days. I hope the support of you all to
> > step forward.
> > > >
> > > > > That's fine. It's still early on in the process so still quite a
bit
> > > > > of time to put together and discuss a proposal.
> > > > >
> > > > >
> > > > > > Thanks.
> > > > >
> > > > > Thanks.
> > > > >
> > > > > Michael Glavassevich
> > > > > XML Parser Development
> > > > > IBM Toronto Lab
> > > > > E-mail: mrglavas@ca.ibm.com
> > > > > E-mail: mrglavas@apache.org
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > >
> > > > > Regards
> > > > >
> > > > > A.S.Thiwanka Somasiri
> > > > >
> > > > > Skype : executionerwild
> > > > > MSN   : thiwas@ymail.com
> > > >
> > > >
> > > > --
> > > >
> > > > Regards
> > > >
> > > > A.S.Thiwanka Somasiri
> > > >
> > > > Skype : executionerwild
> > > > MSN   : thiwas@ymail.com
> > > >
> > > >
---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
> > > > For additional commands, e-mail: j-dev-help@xerces.apache.org
> > >
> > >
> > > Thanks.
> > >
> > > Michael Glavassevich
> > > XML Parser Development
> > > IBM Toronto Lab
> > > E-mail: mrglavas@ca.ibm.com
> > > E-mail: mrglavas@apache.org
> > >
> > >
> > >
> > > --
> > >
> > > Regards
> > >
> > > A.S.Thiwanka Somasiri
> > >
> > > Skype : executionerwild
> > > MSN   : thiwas@ymail.com
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
> > > For additional commands, e-mail: j-dev-help@xerces.apache.org
> >
> >
> >
> > --
> >
> > Regards
> >
> > A.S.Thiwanka Somasiri
> >
> > Skype : executionerwild
> > MSN   : thiwas@ymail.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
> > For additional commands, e-mail: j-dev-help@xerces.apache.org
>
>
>
> --
>
> Regards
>
> A.S.Thiwanka Somasiri
>
> Skype : executionerwild
> MSN   : thiwas@ymail.com

Re: New to Apcahe Xerces

Posted by Thiwanka Somasiri <as...@gmail.com>.
Hi Michaeal and devs,

              I am pretty happy to say that I have selected for this Googls
Summer under "Asynchronous LSParser and parseWithContext()" project. I want
to make this an opportunity to thank Michael and all other devs in the
community for helping me to go through this stage of the project
successfully . All the credit goes to you for creating such a good
background for freshers like us to come and play, and I will do my maximum
to complete this project and to give a valued contribution to Apache
Xerces2-J.

Thanks.


On Wed, Apr 6, 2011 at 8:44 PM, Michael Glavassevich <mr...@ca.ibm.com>wrote:

> Hi Thiwanka,
>
> I've reviewed your revised proposal. Your updates are good.
>
>
> Thanks.
>
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
>
> Thiwanka Somasiri <as...@gmail.com> wrote on 04/05/2011 05:58:42 PM:
>
> > Hi Michael,
>
> >
> >         Thank you for reviewing my proposal and giving me valuable
> > feedbacks. There were some points that I have misunderstood and I
> > corrected them in the proposal. I have attached the modified
> > proposal in this mail and highlighted the newly added/altered areas
> > in the PDF for your convenience. I will enter the proposal in the
> > GSoC tool and I am grateful to you if you can skim through it and
> > check whether there are misunderstood points.
> >
> > Thanks you very much for your guidance & support.
>
> > On Tue, Apr 5, 2011 at 11:40 PM, Michael Glavassevich <
> mrglavas@ca.ibm.com
> > > wrote:
> > Hi Thiwanka,
> >
> > I've just reviewed your proposal. Looks good overall, but I have a
> > few suggestions for improvement:
> >
> > For the asynchronous LSParser it would be good if you mentioned
> > something about how the main thread and the 2nd thread that the
> > parser runs on interact, specifically your thoughts on updating the
> > LSParser's 'busy' state and how a call to abort() would terminate
> > the parsing thread if it hadn't completed yet.
> >
> > The return value of dispatchEvent() is determined to be true/false
> > based on whether preventDefault() was called on the Event by an
> > EventListener, not on whether an EventListener could "handle" the
> > event. It would be good if you would correct that.
> >
> > There's a typo in the parseWithContext() section. I'm sure you meant
> > "<ns2:c/><ns1:d/>" (two empty-tags) instead of "</ns2:c></ns1:d>"
> > (two unpaired end-tags).
> >
> > In the last section on parseWithContext() you seem to be implying
> > that a Document node (as the context node) with an action of
> > ACTION_REPLACE_CHILDREN is an error condition. When I said it was an
> > exception, I meant it was an exceptional case that needed to be
> > handled differently than the other inputs. It's not an error, but is
> > the one case where a whole XML document is expected instead of a
> > fragment. More detail in my previous reply below.
> >
> > Once you're ready feel free to enter your proposal into the GSoC tool.
> >
> > Great work!
> >
> >
> > Thanks.
> >
> > Michael Glavassevich
> > XML Parser Development
> > IBM Toronto Lab
> > E-mail: mrglavas@ca.ibm.com
> > E-mail: mrglavas@apache.org
>
> > Thiwanka Somasiri <as...@gmail.com> wrote on 04/05/2011 12:43:32
> AM:
> >
> > > Hi Michael and devs,
> >
> > >
> > >       As per discussion with Michael Glavassevich about the
> > > "Asynchronous LSParser and parseWithContext()" GSoC project
> > under XERCESJ-1429
> > > , I have prepared my proposal and attached it to this mail. I would
> > > like to know whether I should improve the proposal and if so which
> > > areas should be improved in it. Hope you feedbacks soon since the
> > > deadline is on 8th of April.
> > >
> > > P.S. - Michael, I have included you as the mentor for the project.
> > >
> > > Thanks.
> > >
> > > On Fri, Apr 1, 2011 at 9:58 AM, Michael Glavassevich <
> mrglavas@ca.ibm.com
> > > > wrote:
> > > Hi Thiwanka,
> > >
> > > Thiwanka Somasiri <as...@gmail.com> wrote on 03/31/2011 08:21:55
> AM:
> > >
> > > > Hi Michael,
> > >
> > > >
> > > >                  By using a synthesized wrapper XML document, does
> > > > it mean to convert the fragment to a temporary complete XML document
> > > > (using a dummy root - so it can be parsed like a normal XML
> > > > document), parse it and merge the nodes created with this to the
> > > > existing document? If so, whenever the fragment contains an
> > > > erroneous point, an exception will be thrown. Otherwise we can
> > > > extract the relevant nodes to the XML fragment (removing dummy root
> > > > nodes) and add them to the existing document.
> >
> > > Right, that's what I meant, though you're not really 'converting'
> > > the fragment, but including it by reference in a dummy wrapper XML
> > > document so that it can be parsed like any other XML document. The
> > > one exception is when the context node is a Document node and the
> > > action is ACTION_REPLACE_CHILDREN. You would process the input as a
> > > whole XML document, very similar to if the input was parsed using
> > > the regular LSParser.parse() method.
> > >
> > >
> > > > I have attached an image(http://img145.imageshack.us/i/
> > > > xmlfragmentinsertion.png/) describing what I understood from you
> > > > previous reply. If I have misunderstood that, please correct me.
> >
> > > Your diagram illustrates the idea quite well.
> > >
> > >
> > > > I am looking for your advices to start with my proposal. I want to
> > > > know what are the key point that should be included and is it enough
> > > > to have high level implementation details in the proposal?
> >
> > > Your proposal should include a high level design for the
> > > asynchronous mode for the LSParser and parseWithContext(), as well
> > > as details on your thoughts for implementation. It should include a
> > > plan/timeline for the work you would be doing, some details about
> > > yourself and your development experience, details about the
> > > interaction that you've had with the community and also say
> > > something about the time you would be able to commit to the project
> > > over the summer. Proposals from 2010 are up on the Xerces Wiki (
> > > http://wiki.apache.org/xerces/FrontPage). You may want to take a
> > > look at them to get a better idea of the structure and level of
> > > detail in a successful GSoC proposal.
> > >
> > >
> > > > Thanks.
> > > >
> > > > On Thu, Mar 31, 2011 at 10:40 AM, Michael Glavassevich <
> > mrglavas@ca.ibm.com
> > > > > wrote:
> > > > Hi Thiwanka,
> > > >
> > > > Aside from the previous discussion on the mailing list [1] and the
> > > > specification I'm not aware of any good reading material on
> > > > parseWithContext().
> > > >
> > > > I have given the design more thought since last year and think it
> > > > should be possible to implement this method (in the case where the
> > > > context node is not a Document node) by synthesizing a wrapper XML
> > > > document which contains a reference to the fragment and the
> > > > necessary context (e.g. namespace declarations) required to parse
> > > > the fragment. You can then transfer the nodes created for the
> > > > fragment into the existing DOM.
> > > >
> > > > For example, if your existing document looked like this:
> > > >
> > > > <ns1:a xmlns:ns1="http://ns1">
> > > >  <ns2:b xmlns:ns2="http://ns2"/>
> > > > </ns1:a>
> > > >
> > > > and you wanted to insert an XML fragment like:
> > > >
> > > > <ns2:c/><ns1:d/>
> > > >
> > > > as a child of 'ns2:b', you could generate a wrapper document:
> > > >
> > > > <!DOCTYPE DUMMY_ROOT [
> > > >  <!ENTITY fragment PUBLIC "***" "***">
> > > > ]>
> > > > <DUMMY_ROOT xmlns:ns1="http://ns1" xmlns:ns2="http://ns2
> > > > ">&fragment;</DUMMY_ROOT>
> > > >
> > > > where the 'fragment' entity points to the XML fragment the user
> > > > provided, parse the document you synthesized and then move the nodes
> > > > created underneath the entity reference into the existing document,
> > > > resulting in:
> > > >
> > > > <ns1:a xmlns:ns1="http://ns1">
> > > >  <ns2:b xmlns:ns2="http://ns2"><ns2:c/><ns1:d/></ns2:b>
> > > > </ns1:a>
> > > >
> > > > Hope that made sense.
> > > >
> > > > Thanks.
> > > >
> > > > [1] http://markmail.org/thread/ool7dyyzffor6o7b
> > > >
> > > >
> > > > Michael Glavassevich
> > > > XML Parser Development
> > > > IBM Toronto Lab
> > > > E-mail: mrglavas@ca.ibm.com
> > > > E-mail: mrglavas@apache.org
> > >
> > > > Thiwanka Somasiri <as...@gmail.com> wrote on 03/28/2011
> 02:05:24 PM:
> > > >
> > > > > Hi Michael,
> > > >
> > > > >
> > > > > As I understood, the second part of the project is also a critical
> > > > > implementation, which is known as parseWithContext(). According to
> > > > > the W3C specification[1], this method is used to insert a fragment
> > > > > of and XML document to an existing document. The parameters in the
> > > > > method specify the position where the new fragment should be
> > > > > attached and which action should be triggered between the existing
> > > > > document and the new fragment.
> > > > >
> > > > > The implementation also include an error handling part (in a case
> > > > > where the inserting fragment is erroneous,etc) to notify the caller
>
> > > > > through an ErrorHandler object when an unexpected scenario occur.
> > > > >
> > > > > I need to understand the background for parseWithContext() some
> more
> > > > > and can you tell me what are the useful resources in this regard.
> > > > > (Understanding the overall idea of this will help me to allocate
> > > > > approximate time in the proposal)
> > > > >
> > > > > I would like to start writing a proposal for the project and I need
>
> > > > > a big help from you. I am happy if you can give me an starting
> point
> > > > > and guide lines to write the proposal.
> > > > >
> > > > > [1] http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-
> > > > > save.html#LS-LSParser-parseWithContext
> > > > >
> > > > > Thanks.
> > > > >
> > > > > On Sat, Mar 19, 2011 at 11:41 PM, Michael Glavassevich <
> > > mrglavas@ca.ibm.com
> > > > > > wrote:
> > > > > Hi Thiwanka,
> > > > >
> > > > > Thiwanka Somasiri <as...@gmail.com> wrote on 03/19/2011
> > 02:25:03 AM:
> > > > >
> > > > > > Hi Michael,
> > > > >
> > > > > >
> > > > > >     Thanks for your reply. I will study more on the project
> within
> > > > > > next week and come up with both my issues and ideas. Since I was
> > > > > > having my exams, I could not focus much on the project and will
> be
> > > > > > free after few more days. I hope the support of you all to
> > step forward.
> > > >
> > > > > That's fine. It's still early on in the process so still quite a
> bit
> > > > > of time to put together and discuss a proposal.
> > > > >
> > > > >
> > > > > > Thanks.
> > > > >
> > > > > Thanks.
> > > > >
> > > > > Michael Glavassevich
> > > > > XML Parser Development
> > > > > IBM Toronto Lab
> > > > > E-mail: mrglavas@ca.ibm.com
> > > > > E-mail: mrglavas@apache.org
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > >
> > > > > Regards
> > > > >
> > > > > A.S.Thiwanka Somasiri
> > > > >
> > > > > Skype : executionerwild
> > > > > MSN   : thiwas@ymail.com
> > > >
> > > >
> > > > --
> > > >
> > > > Regards
> > > >
> > > > A.S.Thiwanka Somasiri
> > > >
> > > > Skype : executionerwild
> > > > MSN   : thiwas@ymail.com
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
> > > > For additional commands, e-mail: j-dev-help@xerces.apache.org
> > >
> > >
> > > Thanks.
> > >
> > > Michael Glavassevich
> > > XML Parser Development
> > > IBM Toronto Lab
> > > E-mail: mrglavas@ca.ibm.com
> > > E-mail: mrglavas@apache.org
> > >
> > >
> > >
> > > --
> > >
> > > Regards
> > >
> > > A.S.Thiwanka Somasiri
> > >
> > > Skype : executionerwild
> > > MSN   : thiwas@ymail.com
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
> > > For additional commands, e-mail: j-dev-help@xerces.apache.org
> >
> >
> >
> > --
> >
> > Regards
> >
> > A.S.Thiwanka Somasiri
> >
> > Skype : executionerwild
> > MSN   : thiwas@ymail.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
> > For additional commands, e-mail: j-dev-help@xerces.apache.org
>
>


-- 

Regards

A.S.Thiwanka Somasiri

Skype : executionerwild
MSN   : thiwas@ymail.com
<th...@ymail.com>

Re: New to Apcahe Xerces

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Hi Thiwanka,

I've reviewed your revised proposal. Your updates are good.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Thiwanka Somasiri <as...@gmail.com> wrote on 04/05/2011 05:58:42 PM:

> Hi Michael,
>
>         Thank you for reviewing my proposal and giving me valuable
> feedbacks. There were some points that I have misunderstood and I
> corrected them in the proposal. I have attached the modified
> proposal in this mail and highlighted the newly added/altered areas
> in the PDF for your convenience. I will enter the proposal in the
> GSoC tool and I am grateful to you if you can skim through it and
> check whether there are misunderstood points.
>
> Thanks you very much for your guidance & support.

> On Tue, Apr 5, 2011 at 11:40 PM, Michael Glavassevich
<mrglavas@ca.ibm.com
> > wrote:
> Hi Thiwanka,
>
> I've just reviewed your proposal. Looks good overall, but I have a
> few suggestions for improvement:
>
> For the asynchronous LSParser it would be good if you mentioned
> something about how the main thread and the 2nd thread that the
> parser runs on interact, specifically your thoughts on updating the
> LSParser's 'busy' state and how a call to abort() would terminate
> the parsing thread if it hadn't completed yet.
>
> The return value of dispatchEvent() is determined to be true/false
> based on whether preventDefault() was called on the Event by an
> EventListener, not on whether an EventListener could "handle" the
> event. It would be good if you would correct that.
>
> There's a typo in the parseWithContext() section. I'm sure you meant
> "<ns2:c/><ns1:d/>" (two empty-tags) instead of "</ns2:c></ns1:d>"
> (two unpaired end-tags).
>
> In the last section on parseWithContext() you seem to be implying
> that a Document node (as the context node) with an action of
> ACTION_REPLACE_CHILDREN is an error condition. When I said it was an
> exception, I meant it was an exceptional case that needed to be
> handled differently than the other inputs. It's not an error, but is
> the one case where a whole XML document is expected instead of a
> fragment. More detail in my previous reply below.
>
> Once you're ready feel free to enter your proposal into the GSoC tool.
>
> Great work!
>
>
> Thanks.
>
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org

> Thiwanka Somasiri <as...@gmail.com> wrote on 04/05/2011 12:43:32 AM:
>
> > Hi Michael and devs,
>
> >
> >       As per discussion with Michael Glavassevich about the
> > "Asynchronous LSParser and parseWithContext()" GSoC project
> under XERCESJ-1429
> > , I have prepared my proposal and attached it to this mail. I would
> > like to know whether I should improve the proposal and if so which
> > areas should be improved in it. Hope you feedbacks soon since the
> > deadline is on 8th of April.
> >
> > P.S. - Michael, I have included you as the mentor for the project.
> >
> > Thanks.
> >
> > On Fri, Apr 1, 2011 at 9:58 AM, Michael Glavassevich
<mrglavas@ca.ibm.com
> > > wrote:
> > Hi Thiwanka,
> >
> > Thiwanka Somasiri <as...@gmail.com> wrote on 03/31/2011 08:21:55
AM:
> >
> > > Hi Michael,
> >
> > >
> > >                  By using a synthesized wrapper XML document, does
> > > it mean to convert the fragment to a temporary complete XML document
> > > (using a dummy root - so it can be parsed like a normal XML
> > > document), parse it and merge the nodes created with this to the
> > > existing document? If so, whenever the fragment contains an
> > > erroneous point, an exception will be thrown. Otherwise we can
> > > extract the relevant nodes to the XML fragment (removing dummy root
> > > nodes) and add them to the existing document.
>
> > Right, that's what I meant, though you're not really 'converting'
> > the fragment, but including it by reference in a dummy wrapper XML
> > document so that it can be parsed like any other XML document. The
> > one exception is when the context node is a Document node and the
> > action is ACTION_REPLACE_CHILDREN. You would process the input as a
> > whole XML document, very similar to if the input was parsed using
> > the regular LSParser.parse() method.
> >
> >
> > > I have attached an image(http://img145.imageshack.us/i/
> > > xmlfragmentinsertion.png/) describing what I understood from you
> > > previous reply. If I have misunderstood that, please correct me.
>
> > Your diagram illustrates the idea quite well.
> >
> >
> > > I am looking for your advices to start with my proposal. I want to
> > > know what are the key point that should be included and is it enough
> > > to have high level implementation details in the proposal?
>
> > Your proposal should include a high level design for the
> > asynchronous mode for the LSParser and parseWithContext(), as well
> > as details on your thoughts for implementation. It should include a
> > plan/timeline for the work you would be doing, some details about
> > yourself and your development experience, details about the
> > interaction that you've had with the community and also say
> > something about the time you would be able to commit to the project
> > over the summer. Proposals from 2010 are up on the Xerces Wiki (
> > http://wiki.apache.org/xerces/FrontPage). You may want to take a
> > look at them to get a better idea of the structure and level of
> > detail in a successful GSoC proposal.
> >
> >
> > > Thanks.
> > >
> > > On Thu, Mar 31, 2011 at 10:40 AM, Michael Glavassevich <
> mrglavas@ca.ibm.com
> > > > wrote:
> > > Hi Thiwanka,
> > >
> > > Aside from the previous discussion on the mailing list [1] and the
> > > specification I'm not aware of any good reading material on
> > > parseWithContext().
> > >
> > > I have given the design more thought since last year and think it
> > > should be possible to implement this method (in the case where the
> > > context node is not a Document node) by synthesizing a wrapper XML
> > > document which contains a reference to the fragment and the
> > > necessary context (e.g. namespace declarations) required to parse
> > > the fragment. You can then transfer the nodes created for the
> > > fragment into the existing DOM.
> > >
> > > For example, if your existing document looked like this:
> > >
> > > <ns1:a xmlns:ns1="http://ns1">
> > >  <ns2:b xmlns:ns2="http://ns2"/>
> > > </ns1:a>
> > >
> > > and you wanted to insert an XML fragment like:
> > >
> > > <ns2:c/><ns1:d/>
> > >
> > > as a child of 'ns2:b', you could generate a wrapper document:
> > >
> > > <!DOCTYPE DUMMY_ROOT [
> > >  <!ENTITY fragment PUBLIC "***" "***">
> > > ]>
> > > <DUMMY_ROOT xmlns:ns1="http://ns1" xmlns:ns2="http://ns2
> > > ">&fragment;</DUMMY_ROOT>
> > >
> > > where the 'fragment' entity points to the XML fragment the user
> > > provided, parse the document you synthesized and then move the nodes
> > > created underneath the entity reference into the existing document,
> > > resulting in:
> > >
> > > <ns1:a xmlns:ns1="http://ns1">
> > >  <ns2:b xmlns:ns2="http://ns2"><ns2:c/><ns1:d/></ns2:b>
> > > </ns1:a>
> > >
> > > Hope that made sense.
> > >
> > > Thanks.
> > >
> > > [1] http://markmail.org/thread/ool7dyyzffor6o7b
> > >
> > >
> > > Michael Glavassevich
> > > XML Parser Development
> > > IBM Toronto Lab
> > > E-mail: mrglavas@ca.ibm.com
> > > E-mail: mrglavas@apache.org
> >
> > > Thiwanka Somasiri <as...@gmail.com> wrote on 03/28/2011 02:05:24
PM:
> > >
> > > > Hi Michael,
> > >
> > > >
> > > > As I understood, the second part of the project is also a critical
> > > > implementation, which is known as parseWithContext(). According to
> > > > the W3C specification[1], this method is used to insert a fragment
> > > > of and XML document to an existing document. The parameters in the
> > > > method specify the position where the new fragment should be
> > > > attached and which action should be triggered between the existing
> > > > document and the new fragment.
> > > >
> > > > The implementation also include an error handling part (in a case
> > > > where the inserting fragment is erroneous,etc) to notify the caller

> > > > through an ErrorHandler object when an unexpected scenario occur.
> > > >
> > > > I need to understand the background for parseWithContext() some
more
> > > > and can you tell me what are the useful resources in this regard.
> > > > (Understanding the overall idea of this will help me to allocate
> > > > approximate time in the proposal)
> > > >
> > > > I would like to start writing a proposal for the project and I need

> > > > a big help from you. I am happy if you can give me an starting
point
> > > > and guide lines to write the proposal.
> > > >
> > > > [1] http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-
> > > > save.html#LS-LSParser-parseWithContext
> > > >
> > > > Thanks.
> > > >
> > > > On Sat, Mar 19, 2011 at 11:41 PM, Michael Glavassevich <
> > mrglavas@ca.ibm.com
> > > > > wrote:
> > > > Hi Thiwanka,
> > > >
> > > > Thiwanka Somasiri <as...@gmail.com> wrote on 03/19/2011
> 02:25:03 AM:
> > > >
> > > > > Hi Michael,
> > > >
> > > > >
> > > > >     Thanks for your reply. I will study more on the project
within
> > > > > next week and come up with both my issues and ideas. Since I was
> > > > > having my exams, I could not focus much on the project and will
be
> > > > > free after few more days. I hope the support of you all to
> step forward.
> > >
> > > > That's fine. It's still early on in the process so still quite a
bit
> > > > of time to put together and discuss a proposal.
> > > >
> > > >
> > > > > Thanks.
> > > >
> > > > Thanks.
> > > >
> > > > Michael Glavassevich
> > > > XML Parser Development
> > > > IBM Toronto Lab
> > > > E-mail: mrglavas@ca.ibm.com
> > > > E-mail: mrglavas@apache.org
> > > >
> > > >
> > > >
> > > > --
> > > >
> > > > Regards
> > > >
> > > > A.S.Thiwanka Somasiri
> > > >
> > > > Skype : executionerwild
> > > > MSN   : thiwas@ymail.com
> > >
> > >
> > > --
> > >
> > > Regards
> > >
> > > A.S.Thiwanka Somasiri
> > >
> > > Skype : executionerwild
> > > MSN   : thiwas@ymail.com
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
> > > For additional commands, e-mail: j-dev-help@xerces.apache.org
> >
> >
> > Thanks.
> >
> > Michael Glavassevich
> > XML Parser Development
> > IBM Toronto Lab
> > E-mail: mrglavas@ca.ibm.com
> > E-mail: mrglavas@apache.org
> >
> >
> >
> > --
> >
> > Regards
> >
> > A.S.Thiwanka Somasiri
> >
> > Skype : executionerwild
> > MSN   : thiwas@ymail.com
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
> > For additional commands, e-mail: j-dev-help@xerces.apache.org
>
>
>
> --
>
> Regards
>
> A.S.Thiwanka Somasiri
>
> Skype : executionerwild
> MSN   : thiwas@ymail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-dev-help@xerces.apache.org

Re: New to Apcahe Xerces

Posted by Thiwanka Somasiri <as...@gmail.com>.
Hi Michael,

        Thank you for reviewing my proposal and giving me valuable
feedbacks. There were some points that I have misunderstood and I corrected
them in the proposal. I have attached the modified proposal in this mail and
highlighted the newly added/altered areas in the PDF for your convenience. I
will enter the proposal in the GSoC tool and I am grateful to you if you can
skim through it and check whether there are misunderstood points.

Thanks you very much for your guidance & support.

On Tue, Apr 5, 2011 at 11:40 PM, Michael Glavassevich
<mr...@ca.ibm.com>wrote:

> Hi Thiwanka,
>
> I've just reviewed your proposal. Looks good overall, but I have a few
> suggestions for improvement:
>
> For the asynchronous LSParser it would be good if you mentioned something
> about how the main thread and the 2nd thread that the parser runs on
> interact, specifically your thoughts on updating the LSParser's 'busy' state
> and how a call to abort() would terminate the parsing thread if it hadn't
> completed yet.
>
> The return value of dispatchEvent() is determined to be true/false based on
> whether preventDefault() was called on the Event by an EventListener, not on
> whether an EventListener could "handle" the event. It would be good if you
> would correct that.
>
> There's a typo in the parseWithContext() section. I'm sure you meant "<ns2:c/><ns1:d/>"
> (two empty-tags) instead of "</ns2:c></ns1:d>" (two unpaired end-tags).
>
> In the last section on parseWithContext() you seem to be implying that a
> Document node (as the context node) with an action of
> ACTION_REPLACE_CHILDREN is an error condition. When I said it was an
> exception, I meant it was an exceptional case that needed to be handled
> differently than the other inputs. It's not an error, but is the one case
> where a whole XML document is expected instead of a fragment. More detail in
> my previous reply below.
>
> Once you're ready feel free to enter your proposal into the GSoC tool.
>
> Great work!
>
>
> Thanks.
>
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
>
> Thiwanka Somasiri <as...@gmail.com> wrote on 04/05/2011 12:43:32 AM:
>
> > Hi Michael and devs,
>
> >
> >       As per discussion with Michael Glavassevich about the
> > "Asynchronous LSParser and parseWithContext()" GSoC project
> under XERCESJ-1429
> > , I have prepared my proposal and attached it to this mail. I would
> > like to know whether I should improve the proposal and if so which
> > areas should be improved in it. Hope you feedbacks soon since the
> > deadline is on 8th of April.
> >
> > P.S. - Michael, I have included you as the mentor for the project.
> >
> > Thanks.
> >
> > On Fri, Apr 1, 2011 at 9:58 AM, Michael Glavassevich <
> mrglavas@ca.ibm.com
> > > wrote:
> > Hi Thiwanka,
> >
> > Thiwanka Somasiri <as...@gmail.com> wrote on 03/31/2011 08:21:55
> AM:
> >
> > > Hi Michael,
> >
> > >
> > >                  By using a synthesized wrapper XML document, does
> > > it mean to convert the fragment to a temporary complete XML document
> > > (using a dummy root - so it can be parsed like a normal XML
> > > document), parse it and merge the nodes created with this to the
> > > existing document? If so, whenever the fragment contains an
> > > erroneous point, an exception will be thrown. Otherwise we can
> > > extract the relevant nodes to the XML fragment (removing dummy root
> > > nodes) and add them to the existing document.
>
> > Right, that's what I meant, though you're not really 'converting'
> > the fragment, but including it by reference in a dummy wrapper XML
> > document so that it can be parsed like any other XML document. The
> > one exception is when the context node is a Document node and the
> > action is ACTION_REPLACE_CHILDREN. You would process the input as a
> > whole XML document, very similar to if the input was parsed using
> > the regular LSParser.parse() method.
> >
> >
> > > I have attached an image(http://img145.imageshack.us/i/
> > > xmlfragmentinsertion.png/) describing what I understood from you
> > > previous reply. If I have misunderstood that, please correct me.
>
> > Your diagram illustrates the idea quite well.
> >
> >
> > > I am looking for your advices to start with my proposal. I want to
> > > know what are the key point that should be included and is it enough
> > > to have high level implementation details in the proposal?
>
> > Your proposal should include a high level design for the
> > asynchronous mode for the LSParser and parseWithContext(), as well
> > as details on your thoughts for implementation. It should include a
> > plan/timeline for the work you would be doing, some details about
> > yourself and your development experience, details about the
> > interaction that you've had with the community and also say
> > something about the time you would be able to commit to the project
> > over the summer. Proposals from 2010 are up on the Xerces Wiki (
> > http://wiki.apache.org/xerces/FrontPage). You may want to take a
> > look at them to get a better idea of the structure and level of
> > detail in a successful GSoC proposal.
> >
> >
> > > Thanks.
> > >
> > > On Thu, Mar 31, 2011 at 10:40 AM, Michael Glavassevich <
> mrglavas@ca.ibm.com
> > > > wrote:
> > > Hi Thiwanka,
> > >
> > > Aside from the previous discussion on the mailing list [1] and the
> > > specification I'm not aware of any good reading material on
> > > parseWithContext().
> > >
> > > I have given the design more thought since last year and think it
> > > should be possible to implement this method (in the case where the
> > > context node is not a Document node) by synthesizing a wrapper XML
> > > document which contains a reference to the fragment and the
> > > necessary context (e.g. namespace declarations) required to parse
> > > the fragment. You can then transfer the nodes created for the
> > > fragment into the existing DOM.
> > >
> > > For example, if your existing document looked like this:
> > >
> > > <ns1:a xmlns:ns1="http://ns1">
> > >  <ns2:b xmlns:ns2="http://ns2"/>
> > > </ns1:a>
> > >
> > > and you wanted to insert an XML fragment like:
> > >
> > > <ns2:c/><ns1:d/>
> > >
> > > as a child of 'ns2:b', you could generate a wrapper document:
> > >
> > > <!DOCTYPE DUMMY_ROOT [
> > >  <!ENTITY fragment PUBLIC "***" "***">
> > > ]>
> > > <DUMMY_ROOT xmlns:ns1="http://ns1" xmlns:ns2="http://ns2
> > > ">&fragment;</DUMMY_ROOT>
> > >
> > > where the 'fragment' entity points to the XML fragment the user
> > > provided, parse the document you synthesized and then move the nodes
> > > created underneath the entity reference into the existing document,
> > > resulting in:
> > >
> > > <ns1:a xmlns:ns1="http://ns1">
> > >  <ns2:b xmlns:ns2="http://ns2"><ns2:c/><ns1:d/></ns2:b>
> > > </ns1:a>
> > >
> > > Hope that made sense.
> > >
> > > Thanks.
> > >
> > > [1] http://markmail.org/thread/ool7dyyzffor6o7b
> > >
> > >
> > > Michael Glavassevich
> > > XML Parser Development
> > > IBM Toronto Lab
> > > E-mail: mrglavas@ca.ibm.com
> > > E-mail: mrglavas@apache.org
> >
> > > Thiwanka Somasiri <as...@gmail.com> wrote on 03/28/2011 02:05:24
> PM:
> > >
> > > > Hi Michael,
> > >
> > > >
> > > > As I understood, the second part of the project is also a critical
> > > > implementation, which is known as parseWithContext(). According to
> > > > the W3C specification[1], this method is used to insert a fragment
> > > > of and XML document to an existing document. The parameters in the
> > > > method specify the position where the new fragment should be
> > > > attached and which action should be triggered between the existing
> > > > document and the new fragment.
> > > >
> > > > The implementation also include an error handling part (in a case
> > > > where the inserting fragment is erroneous,etc) to notify the caller
> > > > through an ErrorHandler object when an unexpected scenario occur.
> > > >
> > > > I need to understand the background for parseWithContext() some more
> > > > and can you tell me what are the useful resources in this regard.
> > > > (Understanding the overall idea of this will help me to allocate
> > > > approximate time in the proposal)
> > > >
> > > > I would like to start writing a proposal for the project and I need
> > > > a big help from you. I am happy if you can give me an starting point
> > > > and guide lines to write the proposal.
> > > >
> > > > [1] http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-
> > > > save.html#LS-LSParser-parseWithContext
> > > >
> > > > Thanks.
> > > >
> > > > On Sat, Mar 19, 2011 at 11:41 PM, Michael Glavassevich <
> > mrglavas@ca.ibm.com
> > > > > wrote:
> > > > Hi Thiwanka,
> > > >
> > > > Thiwanka Somasiri <as...@gmail.com> wrote on 03/19/2011
> 02:25:03 AM:
> > > >
> > > > > Hi Michael,
> > > >
> > > > >
> > > > >     Thanks for your reply. I will study more on the project within
> > > > > next week and come up with both my issues and ideas. Since I was
> > > > > having my exams, I could not focus much on the project and will be
> > > > > free after few more days. I hope the support of you all to step
> forward.
> > >
> > > > That's fine. It's still early on in the process so still quite a bit
> > > > of time to put together and discuss a proposal.
> > > >
> > > >
> > > > > Thanks.
> > > >
> > > > Thanks.
> > > >
> > > > Michael Glavassevich
> > > > XML Parser Development
> > > > IBM Toronto Lab
> > > > E-mail: mrglavas@ca.ibm.com
> > > > E-mail: mrglavas@apache.org
> > > >
> > > >
> > > >
> > > > --
> > > >
> > > > Regards
> > > >
> > > > A.S.Thiwanka Somasiri
> > > >
> > > > Skype : executionerwild
> > > > MSN   : thiwas@ymail.com
> > >
> > >
> > > --
> > >
> > > Regards
> > >
> > > A.S.Thiwanka Somasiri
> > >
> > > Skype : executionerwild
> > > MSN   : thiwas@ymail.com
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
> > > For additional commands, e-mail: j-dev-help@xerces.apache.org
> >
> >
> > Thanks.
> >
> > Michael Glavassevich
> > XML Parser Development
> > IBM Toronto Lab
> > E-mail: mrglavas@ca.ibm.com
> > E-mail: mrglavas@apache.org
> >
> >
> >
> > --
> >
> > Regards
> >
> > A.S.Thiwanka Somasiri
> >
> > Skype : executionerwild
> > MSN   : thiwas@ymail.com
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
> > For additional commands, e-mail: j-dev-help@xerces.apache.org
>
>


-- 

Regards

A.S.Thiwanka Somasiri

Skype : executionerwild
MSN   : thiwas@ymail.com
<th...@ymail.com>

Re: New to Apcahe Xerces

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Hi Thiwanka,

I've just reviewed your proposal. Looks good overall, but I have a few
suggestions for improvement:

For the asynchronous LSParser it would be good if you mentioned something
about how the main thread and the 2nd thread that the parser runs on
interact, specifically your thoughts on updating the LSParser's 'busy'
state and how a call to abort() would terminate the parsing thread if it
hadn't completed yet.

The return value of dispatchEvent() is determined to be true/false based on
whether preventDefault() was called on the Event by an EventListener, not
on whether an EventListener could "handle" the event. It would be good if
you would correct that.

There's a typo in the parseWithContext() section. I'm sure you meant "
<ns2:c/><ns1:d/>" (two empty-tags) instead of "</ns2:c></ns1:d>" (two
unpaired end-tags).

In the last section on parseWithContext() you seem to be implying that a
Document node (as the context node) with an action of
ACTION_REPLACE_CHILDREN is an error condition. When I said it was an
exception, I meant it was an exceptional case that needed to be handled
differently than the other inputs. It's not an error, but is the one case
where a whole XML document is expected instead of a fragment. More detail
in my previous reply below.

Once you're ready feel free to enter your proposal into the GSoC tool.

Great work!

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Thiwanka Somasiri <as...@gmail.com> wrote on 04/05/2011 12:43:32 AM:

> Hi Michael and devs,
>
>       As per discussion with Michael Glavassevich about the
> "Asynchronous LSParser and parseWithContext()" GSoC project
under XERCESJ-1429
> , I have prepared my proposal and attached it to this mail. I would
> like to know whether I should improve the proposal and if so which
> areas should be improved in it. Hope you feedbacks soon since the
> deadline is on 8th of April.
>
> P.S. - Michael, I have included you as the mentor for the project.
>
> Thanks.
>
> On Fri, Apr 1, 2011 at 9:58 AM, Michael Glavassevich <mrglavas@ca.ibm.com
> > wrote:
> Hi Thiwanka,
>
> Thiwanka Somasiri <as...@gmail.com> wrote on 03/31/2011 08:21:55 AM:
>
> > Hi Michael,
>
> >
> >                  By using a synthesized wrapper XML document, does
> > it mean to convert the fragment to a temporary complete XML document
> > (using a dummy root - so it can be parsed like a normal XML
> > document), parse it and merge the nodes created with this to the
> > existing document? If so, whenever the fragment contains an
> > erroneous point, an exception will be thrown. Otherwise we can
> > extract the relevant nodes to the XML fragment (removing dummy root
> > nodes) and add them to the existing document.

> Right, that's what I meant, though you're not really 'converting'
> the fragment, but including it by reference in a dummy wrapper XML
> document so that it can be parsed like any other XML document. The
> one exception is when the context node is a Document node and the
> action is ACTION_REPLACE_CHILDREN. You would process the input as a
> whole XML document, very similar to if the input was parsed using
> the regular LSParser.parse() method.
>
>
> > I have attached an image(http://img145.imageshack.us/i/
> > xmlfragmentinsertion.png/) describing what I understood from you
> > previous reply. If I have misunderstood that, please correct me.

> Your diagram illustrates the idea quite well.
>
>
> > I am looking for your advices to start with my proposal. I want to
> > know what are the key point that should be included and is it enough
> > to have high level implementation details in the proposal?

> Your proposal should include a high level design for the
> asynchronous mode for the LSParser and parseWithContext(), as well
> as details on your thoughts for implementation. It should include a
> plan/timeline for the work you would be doing, some details about
> yourself and your development experience, details about the
> interaction that you've had with the community and also say
> something about the time you would be able to commit to the project
> over the summer. Proposals from 2010 are up on the Xerces Wiki (
> http://wiki.apache.org/xerces/FrontPage). You may want to take a
> look at them to get a better idea of the structure and level of
> detail in a successful GSoC proposal.
>
>
> > Thanks.
> >
> > On Thu, Mar 31, 2011 at 10:40 AM, Michael Glavassevich
<mrglavas@ca.ibm.com
> > > wrote:
> > Hi Thiwanka,
> >
> > Aside from the previous discussion on the mailing list [1] and the
> > specification I'm not aware of any good reading material on
> > parseWithContext().
> >
> > I have given the design more thought since last year and think it
> > should be possible to implement this method (in the case where the
> > context node is not a Document node) by synthesizing a wrapper XML
> > document which contains a reference to the fragment and the
> > necessary context (e.g. namespace declarations) required to parse
> > the fragment. You can then transfer the nodes created for the
> > fragment into the existing DOM.
> >
> > For example, if your existing document looked like this:
> >
> > <ns1:a xmlns:ns1="http://ns1">
> >  <ns2:b xmlns:ns2="http://ns2"/>
> > </ns1:a>
> >
> > and you wanted to insert an XML fragment like:
> >
> > <ns2:c/><ns1:d/>
> >
> > as a child of 'ns2:b', you could generate a wrapper document:
> >
> > <!DOCTYPE DUMMY_ROOT [
> >  <!ENTITY fragment PUBLIC "***" "***">
> > ]>
> > <DUMMY_ROOT xmlns:ns1="http://ns1" xmlns:ns2="http://ns2
> > ">&fragment;</DUMMY_ROOT>
> >
> > where the 'fragment' entity points to the XML fragment the user
> > provided, parse the document you synthesized and then move the nodes
> > created underneath the entity reference into the existing document,
> > resulting in:
> >
> > <ns1:a xmlns:ns1="http://ns1">
> >  <ns2:b xmlns:ns2="http://ns2"><ns2:c/><ns1:d/></ns2:b>
> > </ns1:a>
> >
> > Hope that made sense.
> >
> > Thanks.
> >
> > [1] http://markmail.org/thread/ool7dyyzffor6o7b
> >
> >
> > Michael Glavassevich
> > XML Parser Development
> > IBM Toronto Lab
> > E-mail: mrglavas@ca.ibm.com
> > E-mail: mrglavas@apache.org
>
> > Thiwanka Somasiri <as...@gmail.com> wrote on 03/28/2011 02:05:24
PM:
> >
> > > Hi Michael,
> >
> > >
> > > As I understood, the second part of the project is also a critical
> > > implementation, which is known as parseWithContext(). According to
> > > the W3C specification[1], this method is used to insert a fragment
> > > of and XML document to an existing document. The parameters in the
> > > method specify the position where the new fragment should be
> > > attached and which action should be triggered between the existing
> > > document and the new fragment.
> > >
> > > The implementation also include an error handling part (in a case
> > > where the inserting fragment is erroneous,etc) to notify the caller
> > > through an ErrorHandler object when an unexpected scenario occur.
> > >
> > > I need to understand the background for parseWithContext() some more
> > > and can you tell me what are the useful resources in this regard.
> > > (Understanding the overall idea of this will help me to allocate
> > > approximate time in the proposal)
> > >
> > > I would like to start writing a proposal for the project and I need
> > > a big help from you. I am happy if you can give me an starting point
> > > and guide lines to write the proposal.
> > >
> > > [1] http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-
> > > save.html#LS-LSParser-parseWithContext
> > >
> > > Thanks.
> > >
> > > On Sat, Mar 19, 2011 at 11:41 PM, Michael Glavassevich <
> mrglavas@ca.ibm.com
> > > > wrote:
> > > Hi Thiwanka,
> > >
> > > Thiwanka Somasiri <as...@gmail.com> wrote on 03/19/2011 02:25:03
AM:
> > >
> > > > Hi Michael,
> > >
> > > >
> > > >     Thanks for your reply. I will study more on the project within
> > > > next week and come up with both my issues and ideas. Since I was
> > > > having my exams, I could not focus much on the project and will be
> > > > free after few more days. I hope the support of you all to step
forward.
> >
> > > That's fine. It's still early on in the process so still quite a bit
> > > of time to put together and discuss a proposal.
> > >
> > >
> > > > Thanks.
> > >
> > > Thanks.
> > >
> > > Michael Glavassevich
> > > XML Parser Development
> > > IBM Toronto Lab
> > > E-mail: mrglavas@ca.ibm.com
> > > E-mail: mrglavas@apache.org
> > >
> > >
> > >
> > > --
> > >
> > > Regards
> > >
> > > A.S.Thiwanka Somasiri
> > >
> > > Skype : executionerwild
> > > MSN   : thiwas@ymail.com
> >
> >
> > --
> >
> > Regards
> >
> > A.S.Thiwanka Somasiri
> >
> > Skype : executionerwild
> > MSN   : thiwas@ymail.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
> > For additional commands, e-mail: j-dev-help@xerces.apache.org
>
>
> Thanks.
>
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
>
>
>
> --
>
> Regards
>
> A.S.Thiwanka Somasiri
>
> Skype : executionerwild
> MSN   : thiwas@ymail.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-dev-help@xerces.apache.org

Re: New to Apcahe Xerces

Posted by Thiwanka Somasiri <as...@gmail.com>.
Hi Michael and devs,

      As per discussion with Michael Glavassevich about the "Asynchronous
LSParser and parseWithContext()" GSoC project under
XERCESJ-1429<https://issues.apache.org/jira/browse/XERCESJ-1429>
, I have prepared my proposal and attached it to this mail. I would like to
know whether I should improve the proposal and if so which areas should be
improved in it. Hope you feedbacks soon since the deadline is on 8th of
April.

P.S. - Michael, I have included you as the mentor for the project.

Thanks.

On Fri, Apr 1, 2011 at 9:58 AM, Michael Glavassevich <mr...@ca.ibm.com>wrote:

> Hi Thiwanka,
>
> Thiwanka Somasiri <as...@gmail.com> wrote on 03/31/2011 08:21:55 AM:
>
> > Hi Michael,
>
> >
> >                  By using a synthesized wrapper XML document, does
> > it mean to convert the fragment to a temporary complete XML document
> > (using a dummy root - so it can be parsed like a normal XML
> > document), parse it and merge the nodes created with this to the
> > existing document? If so, whenever the fragment contains an
> > erroneous point, an exception will be thrown. Otherwise we can
> > extract the relevant nodes to the XML fragment (removing dummy root
> > nodes) and add them to the existing document.
>
> Right, that's what I meant, though you're not really 'converting' the
> fragment, but including it by reference in a dummy wrapper XML document so
> that it can be parsed like any other XML document. The one exception is
> when the context node is a Document node and the action is
> ACTION_REPLACE_CHILDREN. You would process the input as a whole XML
> document, very similar to if the input was parsed using the regular
> LSParser.parse() method.
>
>
> > I have attached an image(http://img145.imageshack.us/i/
> > xmlfragmentinsertion.png/) describing what I understood from you
> > previous reply. If I have misunderstood that, please correct me.
>
> Your diagram illustrates the idea quite well.
>
>
> > I am looking for your advices to start with my proposal. I want to
> > know what are the key point that should be included and is it enough
> > to have high level implementation details in the proposal?
>
> Your proposal should include a high level design for the asynchronous mode
> for the LSParser and parseWithContext(), as well as details on your thoughts
> for implementation. It should include a plan/timeline for the work you would
> be doing, some details about yourself and your development experience,
> details about the interaction that you've had with the community and also
> say something about the time you would be able to commit to the project over
> the summer. Proposals from 2010 are up on the Xerces Wiki (
> http://wiki.apache.org/xerces/FrontPage). You may want to take a look at
> them to get a better idea of the structure and level of detail in a
> successful GSoC proposal.
>
>
> > Thanks.
> >
> > On Thu, Mar 31, 2011 at 10:40 AM, Michael Glavassevich <
> mrglavas@ca.ibm.com
> > > wrote:
> > Hi Thiwanka,
> >
> > Aside from the previous discussion on the mailing list [1] and the
> > specification I'm not aware of any good reading material on
> > parseWithContext().
> >
> > I have given the design more thought since last year and think it
> > should be possible to implement this method (in the case where the
> > context node is not a Document node) by synthesizing a wrapper XML
> > document which contains a reference to the fragment and the
> > necessary context (e.g. namespace declarations) required to parse
> > the fragment. You can then transfer the nodes created for the
> > fragment into the existing DOM.
> >
> > For example, if your existing document looked like this:
> >
> > <ns1:a xmlns:ns1="http://ns1">
> >  <ns2:b xmlns:ns2="http://ns2"/>
> > </ns1:a>
> >
> > and you wanted to insert an XML fragment like:
> >
> > <ns2:c/><ns1:d/>
> >
> > as a child of 'ns2:b', you could generate a wrapper document:
> >
> > <!DOCTYPE DUMMY_ROOT [
> >  <!ENTITY fragment PUBLIC "***" "***">
> > ]>
> > <DUMMY_ROOT xmlns:ns1="http://ns1" xmlns:ns2="http://ns2
> > ">&fragment;</DUMMY_ROOT>
> >
> > where the 'fragment' entity points to the XML fragment the user
> > provided, parse the document you synthesized and then move the nodes
> > created underneath the entity reference into the existing document,
> > resulting in:
> >
> > <ns1:a xmlns:ns1="http://ns1">
> >  <ns2:b xmlns:ns2="http://ns2"><ns2:c/><ns1:d/></ns2:b>
> > </ns1:a>
> >
> > Hope that made sense.
> >
> > Thanks.
> >
> > [1] http://markmail.org/thread/ool7dyyzffor6o7b
> >
> >
> > Michael Glavassevich
> > XML Parser Development
> > IBM Toronto Lab
> > E-mail: mrglavas@ca.ibm.com
> > E-mail: mrglavas@apache.org
>
> > Thiwanka Somasiri <as...@gmail.com> wrote on 03/28/2011 02:05:24
> PM:
> >
> > > Hi Michael,
> >
> > >
> > > As I understood, the second part of the project is also a critical
> > > implementation, which is known as parseWithContext(). According to
> > > the W3C specification[1], this method is used to insert a fragment
> > > of and XML document to an existing document. The parameters in the
> > > method specify the position where the new fragment should be
> > > attached and which action should be triggered between the existing
> > > document and the new fragment.
> > >
> > > The implementation also include an error handling part (in a case
> > > where the inserting fragment is erroneous,etc) to notify the caller
> > > through an ErrorHandler object when an unexpected scenario occur.
> > >
> > > I need to understand the background for parseWithContext() some more
> > > and can you tell me what are the useful resources in this regard.
> > > (Understanding the overall idea of this will help me to allocate
> > > approximate time in the proposal)
> > >
> > > I would like to start writing a proposal for the project and I need
> > > a big help from you. I am happy if you can give me an starting point
> > > and guide lines to write the proposal.
> > >
> > > [1] http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-
> > > save.html#LS-LSParser-parseWithContext
> > >
> > > Thanks.
> > >
> > > On Sat, Mar 19, 2011 at 11:41 PM, Michael Glavassevich <
> mrglavas@ca.ibm.com
> > > > wrote:
> > > Hi Thiwanka,
> > >
> > > Thiwanka Somasiri <as...@gmail.com> wrote on 03/19/2011 02:25:03
> AM:
> > >
> > > > Hi Michael,
> > >
> > > >
> > > >     Thanks for your reply. I will study more on the project within
> > > > next week and come up with both my issues and ideas. Since I was
> > > > having my exams, I could not focus much on the project and will be
> > > > free after few more days. I hope the support of you all to step
> forward.
> >
> > > That's fine. It's still early on in the process so still quite a bit
> > > of time to put together and discuss a proposal.
> > >
> > >
> > > > Thanks.
> > >
> > > Thanks.
> > >
> > > Michael Glavassevich
> > > XML Parser Development
> > > IBM Toronto Lab
> > > E-mail: mrglavas@ca.ibm.com
> > > E-mail: mrglavas@apache.org
> > >
> > >
> > >
> > > --
> > >
> > > Regards
> > >
> > > A.S.Thiwanka Somasiri
> > >
> > > Skype : executionerwild
> > > MSN   : thiwas@ymail.com
> >
> >
> > --
> >
> > Regards
> >
> > A.S.Thiwanka Somasiri
> >
> > Skype : executionerwild
> > MSN   : thiwas@ymail.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
> > For additional commands, e-mail: j-dev-help@xerces.apache.org
>
>
> Thanks.
>
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
>
>


-- 

Regards

A.S.Thiwanka Somasiri

Skype : executionerwild
MSN   : thiwas@ymail.com
<th...@ymail.com>

Re: New to Apcahe Xerces

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Hi Thiwanka,

Thiwanka Somasiri <as...@gmail.com> wrote on 03/31/2011 08:21:55 AM:

> Hi Michael,
>
>                  By using a synthesized wrapper XML document, does
> it mean to convert the fragment to a temporary complete XML document
> (using a dummy root - so it can be parsed like a normal XML
> document), parse it and merge the nodes created with this to the
> existing document? If so, whenever the fragment contains an
> erroneous point, an exception will be thrown. Otherwise we can
> extract the relevant nodes to the XML fragment (removing dummy root
> nodes) and add them to the existing document.

Right, that's what I meant, though you're not really 'converting' the
fragment, but including it by reference in a dummy wrapper XML document so
that it can be parsed like any other XML document. The one exception is
when the context node is a Document node and the action is
ACTION_REPLACE_CHILDREN. You would process the input as a whole XML
document, very similar to if the input was parsed using the regular
LSParser.parse() method.

> I have attached an image(http://img145.imageshack.us/i/
> xmlfragmentinsertion.png/) describing what I understood from you
> previous reply. If I have misunderstood that, please correct me.

Your diagram illustrates the idea quite well.

> I am looking for your advices to start with my proposal. I want to
> know what are the key point that should be included and is it enough
> to have high level implementation details in the proposal?

Your proposal should include a high level design for the asynchronous mode
for the LSParser and parseWithContext(), as well as details on your
thoughts for implementation. It should include a plan/timeline for the work
you would be doing, some details about yourself and your development
experience, details about the interaction that you've had with the
community and also say something about the time you would be able to commit
to the project over the summer. Proposals from 2010 are up on the Xerces
Wiki (http://wiki.apache.org/xerces/FrontPage). You may want to take a look
at them to get a better idea of the structure and level of detail in a
successful GSoC proposal.

> Thanks.
>
> On Thu, Mar 31, 2011 at 10:40 AM, Michael Glavassevich
<mrglavas@ca.ibm.com
> > wrote:
> Hi Thiwanka,
>
> Aside from the previous discussion on the mailing list [1] and the
> specification I'm not aware of any good reading material on
> parseWithContext().
>
> I have given the design more thought since last year and think it
> should be possible to implement this method (in the case where the
> context node is not a Document node) by synthesizing a wrapper XML
> document which contains a reference to the fragment and the
> necessary context (e.g. namespace declarations) required to parse
> the fragment. You can then transfer the nodes created for the
> fragment into the existing DOM.
>
> For example, if your existing document looked like this:
>
> <ns1:a xmlns:ns1="http://ns1">
>  <ns2:b xmlns:ns2="http://ns2"/>
> </ns1:a>
>
> and you wanted to insert an XML fragment like:
>
> <ns2:c/><ns1:d/>
>
> as a child of 'ns2:b', you could generate a wrapper document:
>
> <!DOCTYPE DUMMY_ROOT [
>  <!ENTITY fragment PUBLIC "***" "***">
> ]>
> <DUMMY_ROOT xmlns:ns1="http://ns1" xmlns:ns2="http://ns2
> ">&fragment;</DUMMY_ROOT>
>
> where the 'fragment' entity points to the XML fragment the user
> provided, parse the document you synthesized and then move the nodes
> created underneath the entity reference into the existing document,
> resulting in:
>
> <ns1:a xmlns:ns1="http://ns1">
>  <ns2:b xmlns:ns2="http://ns2"><ns2:c/><ns1:d/></ns2:b>
> </ns1:a>
>
> Hope that made sense.
>
> Thanks.
>
> [1] http://markmail.org/thread/ool7dyyzffor6o7b
>
>
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org

> Thiwanka Somasiri <as...@gmail.com> wrote on 03/28/2011 02:05:24 PM:
>
> > Hi Michael,
>
> >
> > As I understood, the second part of the project is also a critical
> > implementation, which is known as parseWithContext(). According to
> > the W3C specification[1], this method is used to insert a fragment
> > of and XML document to an existing document. The parameters in the
> > method specify the position where the new fragment should be
> > attached and which action should be triggered between the existing
> > document and the new fragment.
> >
> > The implementation also include an error handling part (in a case
> > where the inserting fragment is erroneous,etc) to notify the caller
> > through an ErrorHandler object when an unexpected scenario occur.
> >
> > I need to understand the background for parseWithContext() some more
> > and can you tell me what are the useful resources in this regard.
> > (Understanding the overall idea of this will help me to allocate
> > approximate time in the proposal)
> >
> > I would like to start writing a proposal for the project and I need
> > a big help from you. I am happy if you can give me an starting point
> > and guide lines to write the proposal.
> >
> > [1] http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-
> > save.html#LS-LSParser-parseWithContext
> >
> > Thanks.
> >
> > On Sat, Mar 19, 2011 at 11:41 PM, Michael Glavassevich
<mrglavas@ca.ibm.com
> > > wrote:
> > Hi Thiwanka,
> >
> > Thiwanka Somasiri <as...@gmail.com> wrote on 03/19/2011 02:25:03
AM:
> >
> > > Hi Michael,
> >
> > >
> > >     Thanks for your reply. I will study more on the project within
> > > next week and come up with both my issues and ideas. Since I was
> > > having my exams, I could not focus much on the project and will be
> > > free after few more days. I hope the support of you all to step
forward.
>
> > That's fine. It's still early on in the process so still quite a bit
> > of time to put together and discuss a proposal.
> >
> >
> > > Thanks.
> >
> > Thanks.
> >
> > Michael Glavassevich
> > XML Parser Development
> > IBM Toronto Lab
> > E-mail: mrglavas@ca.ibm.com
> > E-mail: mrglavas@apache.org
> >
> >
> >
> > --
> >
> > Regards
> >
> > A.S.Thiwanka Somasiri
> >
> > Skype : executionerwild
> > MSN   : thiwas@ymail.com
>
>
> --
>
> Regards
>
> A.S.Thiwanka Somasiri
>
> Skype : executionerwild
> MSN   : thiwas@ymail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-dev-help@xerces.apache.org

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Re: New to Apcahe Xerces

Posted by Thiwanka Somasiri <as...@gmail.com>.
Hi Michael,

                 By using a synthesized wrapper XML document, does it mean
to convert the fragment to a temporary complete XML document (using a dummy
root - so it can be parsed like a normal XML document), parse it and merge
the nodes created with this to the existing document? If so, whenever the
fragment contains an erroneous point, an exception will be thrown. Otherwise
we can extract the relevant nodes to the XML fragment (removing dummy root
nodes) and add them to the existing document.

I have attached an image(
http://img145.imageshack.us/i/xmlfragmentinsertion.png/) describing what I
understood from you previous reply. If I have misunderstood that, please
correct me.

I am looking for your advices to start with my proposal. I want to know what
are the key point that should be included and is it enough to have high
level implementation details in the proposal?

Thanks.

On Thu, Mar 31, 2011 at 10:40 AM, Michael Glavassevich
<mr...@ca.ibm.com>wrote:

> Hi Thiwanka,
>
> Aside from the previous discussion on the mailing list [1] and the
> specification I'm not aware of any good reading material on
> parseWithContext().
>
> I have given the design more thought since last year and think it should be
> possible to implement this method (in the case where the context node is not
> a Document node) by synthesizing a wrapper XML document which contains a
> reference to the fragment and the necessary context (e.g. namespace
> declarations) required to parse the fragment. You can then transfer the
> nodes created for the fragment into the existing DOM.
>
> For example, if your existing document looked like this:
>
> <ns1:a xmlns:ns1="http://ns1">
>  <ns2:b xmlns:ns2="http://ns2"/>
> </ns1:a>
>
> and you wanted to insert an XML fragment like:
>
> <ns2:c/><ns1:d/>
>
> as a child of 'ns2:b', you could generate a wrapper document:
>
> <!DOCTYPE DUMMY_ROOT [
>  <!ENTITY fragment PUBLIC "***" "***">
> ]>
> <DUMMY_ROOT xmlns:ns1="http://ns1" xmlns:ns2="http://ns2
> ">&fragment;</DUMMY_ROOT>
>
> where the 'fragment' entity points to the XML fragment the user provided,
> parse the document you synthesized and then move the nodes created
> underneath the entity reference into the existing document, resulting in:
>
> <ns1:a xmlns:ns1="http://ns1">
>  <ns2:b xmlns:ns2="http://ns2"><ns2:c/><ns1:d/></ns2:b>
> </ns1:a>
>
> Hope that made sense.
>
> Thanks.
>
> [1] http://markmail.org/thread/ool7dyyzffor6o7b
>
>
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
>
> Thiwanka Somasiri <as...@gmail.com> wrote on 03/28/2011 02:05:24 PM:
>
> > Hi Michael,
>
> >
> > As I understood, the second part of the project is also a critical
> > implementation, which is known as parseWithContext(). According to
> > the W3C specification[1], this method is used to insert a fragment
> > of and XML document to an existing document. The parameters in the
> > method specify the position where the new fragment should be
> > attached and which action should be triggered between the existing
> > document and the new fragment.
> >
> > The implementation also include an error handling part (in a case
> > where the inserting fragment is erroneous,etc) to notify the caller
> > through an ErrorHandler object when an unexpected scenario occur.
> >
> > I need to understand the background for parseWithContext() some more
> > and can you tell me what are the useful resources in this regard.
> > (Understanding the overall idea of this will help me to allocate
> > approximate time in the proposal)
> >
> > I would like to start writing a proposal for the project and I need
> > a big help from you. I am happy if you can give me an starting point
> > and guide lines to write the proposal.
> >
> > [1] http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-
> > save.html#LS-LSParser-parseWithContext
> >
> > Thanks.
> >
> > On Sat, Mar 19, 2011 at 11:41 PM, Michael Glavassevich <
> mrglavas@ca.ibm.com
> > > wrote:
> > Hi Thiwanka,
> >
> > Thiwanka Somasiri <as...@gmail.com> wrote on 03/19/2011 02:25:03
> AM:
> >
> > > Hi Michael,
> >
> > >
> > >     Thanks for your reply. I will study more on the project within
> > > next week and come up with both my issues and ideas. Since I was
> > > having my exams, I could not focus much on the project and will be
> > > free after few more days. I hope the support of you all to step
> forward.
>
> > That's fine. It's still early on in the process so still quite a bit
> > of time to put together and discuss a proposal.
> >
> >
> > > Thanks.
> >
> > Thanks.
> >
> > Michael Glavassevich
> > XML Parser Development
> > IBM Toronto Lab
> > E-mail: mrglavas@ca.ibm.com
> > E-mail: mrglavas@apache.org
> >
> >
> >
> > --
> >
> > Regards
> >
> > A.S.Thiwanka Somasiri
> >
> > Skype : executionerwild
> > MSN   : thiwas@ymail.com
>
>


-- 

Regards

A.S.Thiwanka Somasiri

Skype : executionerwild
MSN   : thiwas@ymail.com
<th...@ymail.com>

Re: New to Apcahe Xerces

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Hi Thiwanka,

Aside from the previous discussion on the mailing list [1] and the
specification I'm not aware of any good reading material on
parseWithContext().

I have given the design more thought since last year and think it should be
possible to implement this method (in the case where the context node is
not a Document node) by synthesizing a wrapper XML document which contains
a reference to the fragment and the necessary context (e.g. namespace
declarations) required to parse the fragment. You can then transfer the
nodes created for the fragment into the existing DOM.

For example, if your existing document looked like this:

<ns1:a xmlns:ns1="http://ns1">
 <ns2:b xmlns:ns2="http://ns2"/>
</ns1:a>

and you wanted to insert an XML fragment like:

<ns2:c/><ns1:d/>

as a child of 'ns2:b', you could generate a wrapper document:

<!DOCTYPE DUMMY_ROOT [
 <!ENTITY fragment PUBLIC "***" "***">
]>
<DUMMY_ROOT xmlns:ns1="http://ns1"
xmlns:ns2="http://ns2">&fragment;</DUMMY_ROOT>

where the 'fragment' entity points to the XML fragment the user provided,
parse the document you synthesized and then move the nodes created
underneath the entity reference into the existing document, resulting in:

<ns1:a xmlns:ns1="http://ns1">
 <ns2:b xmlns:ns2="http://ns2"><ns2:c/><ns1:d/></ns2:b>
</ns1:a>

Hope that made sense.

Thanks.

[1] http://markmail.org/thread/ool7dyyzffor6o7b

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Thiwanka Somasiri <as...@gmail.com> wrote on 03/28/2011 02:05:24 PM:

> Hi Michael,
>
> As I understood, the second part of the project is also a critical
> implementation, which is known as parseWithContext(). According to
> the W3C specification[1], this method is used to insert a fragment
> of and XML document to an existing document. The parameters in the
> method specify the position where the new fragment should be
> attached and which action should be triggered between the existing
> document and the new fragment.
>
> The implementation also include an error handling part (in a case
> where the inserting fragment is erroneous,etc) to notify the caller
> through an ErrorHandler object when an unexpected scenario occur.
>
> I need to understand the background for parseWithContext() some more
> and can you tell me what are the useful resources in this regard.
> (Understanding the overall idea of this will help me to allocate
> approximate time in the proposal)
>
> I would like to start writing a proposal for the project and I need
> a big help from you. I am happy if you can give me an starting point
> and guide lines to write the proposal.
>
> [1] http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-
> save.html#LS-LSParser-parseWithContext
>
> Thanks.
>
> On Sat, Mar 19, 2011 at 11:41 PM, Michael Glavassevich
<mrglavas@ca.ibm.com
> > wrote:
> Hi Thiwanka,
>
> Thiwanka Somasiri <as...@gmail.com> wrote on 03/19/2011 02:25:03 AM:
>
> > Hi Michael,
>
> >
> >     Thanks for your reply. I will study more on the project within
> > next week and come up with both my issues and ideas. Since I was
> > having my exams, I could not focus much on the project and will be
> > free after few more days. I hope the support of you all to step
forward.

> That's fine. It's still early on in the process so still quite a bit
> of time to put together and discuss a proposal.
>
>
> > Thanks.
>
> Thanks.
>
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
>
>
>
> --
>
> Regards
>
> A.S.Thiwanka Somasiri
>
> Skype : executionerwild
> MSN   : thiwas@ymail.com

Re: New to Apcahe Xerces

Posted by Thiwanka Somasiri <as...@gmail.com>.
Hi Michael,

As I understood, the second part of the project is also a critical
implementation, which is known as parseWithContext(). According to the W3C
specification[1], this method is used to insert a fragment of and XML
document to an existing document. The parameters in the method specify the
position where the new fragment should be attached and which action should
be triggered between the existing document and the new fragment.

The implementation also include an error handling part (in a case where the
inserting fragment is erroneous,etc) to notify the caller through an
ErrorHandler object when an unexpected scenario occur.

I need to understand the background for parseWithContext() some more and can
you tell me what are the useful resources in this regard. (Understanding the
overall idea of this will help me to allocate approximate time in the
proposal)

I would like to start writing a proposal for the project and I need a big
help from you. I am happy if you can give me an starting point and guide
lines to write the proposal.

[1]
http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save.html#LS-LSParser-parseWithContext

Thanks.

On Sat, Mar 19, 2011 at 11:41 PM, Michael Glavassevich
<mr...@ca.ibm.com>wrote:

> Hi Thiwanka,
>
> Thiwanka Somasiri <as...@gmail.com> wrote on 03/19/2011 02:25:03 AM:
>
> > Hi Michael,
>
> >
> >     Thanks for your reply. I will study more on the project within
> > next week and come up with both my issues and ideas. Since I was
> > having my exams, I could not focus much on the project and will be
> > free after few more days. I hope the support of you all to step forward.
>
> That's fine. It's still early on in the process so still quite a bit of
> time to put together and discuss a proposal.
>
>
> > Thanks.
>
> Thanks.
>
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
>
>


-- 

Regards

A.S.Thiwanka Somasiri

Skype : executionerwild
MSN   : thiwas@ymail.com
<th...@ymail.com>

Re: New to Apcahe Xerces

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Hi Thiwanka,

Thiwanka Somasiri <as...@gmail.com> wrote on 03/19/2011 02:25:03 AM:

> Hi Michael,
>
>     Thanks for your reply. I will study more on the project within
> next week and come up with both my issues and ideas. Since I was
> having my exams, I could not focus much on the project and will be
> free after few more days. I hope the support of you all to step forward.

That's fine. It's still early on in the process so still quite a bit of
time to put together and discuss a proposal.

> Thanks.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Re: New to Apcahe Xerces

Posted by Thiwanka Somasiri <as...@gmail.com>.
Hi Michael,

    Thanks for your reply. I will study more on the project within next week
and come up with both my issues and ideas. Since I was having my exams, I
could not focus much on the project and will be free after few more days. I
hope the support of you all to step forward.

Thanks.

On Mon, Mar 14, 2011 at 11:13 PM, Michael Glavassevich
<mr...@ca.ibm.com>wrote:

> Hi Thiwanka,
>
> Thiwanka Somasiri <as...@gmail.com> wrote on 02/18/2011 04:12:27 PM:
>
> > Hi Michael,
>
> >         I was studying the facts you were asking me to follow and
> > got an understanding about what Events, event capture, event
> > bubbling, etc are [1][2] and went through the spec for EventListener
> > and EventTraget interfaces. Also I noticed
> > the DocumentImpl and NodeImpl classes are having event processing
> > aspects and they represent the root of the document of the tree and
> > structure of the tree(nodes) respectively. In [2], it depicts how an
> > event occurred is dispatched down the tree explaining event capture
> > and event bubbling. But I am not clear how this "dispatching event"
> > is happening and need some help from you to figure it out.
>
> I expect the dispatch for the LSParser to be much simpler than the general
> case. Unlike the DOM tree which has ancestor nodes, there's only one
> EventTarget (i.e. the LSParser) here.
>
>
> >         The W3C specification indicates, that events supported by
> > asynchronous LSParser objects are LSLoadEvent and LSProgressEvent.
> > So, are these the only Event classes that we have to implement
> > (in org.apache.xerces.dom.events package) in order to support async
> LSParser?
>
> That's correct.
>
>
> >          I also have an issue of LSLoadEvent. In the spec it clearly
> > describes the asynchronous property of LSProgressevent with an
> > example. But I cannot imagine such an example where LSParser behaves
> > asynchronously with LSLoadEvent because, LSLoadEvent is intended to
> > signal the completion of a document load where it does not imply an
> > async property(for example, if it signals the progress of loading
> > the document we can assume that it is async as it was in
> > LSLoadProgressevent). I want to clarify this too(anyway I may be
> > wrong and may have misunderstood the case.)
>
> The process is asynchronous. When you call parse() on an asynchronous
> LSParser it returns immediately with null. At this point the Document may
> not have been constructed yet. At some point later when the parser has
> completed its work, an LSLoadEvent is fired at the EventListener which
> contains the completed Document that has finished loading. The thread which
> called parse() is free to do other work while the parser is busy (on another
> thread).
>
>
> >          I will go through the DOM implementation some more in
> > upcoming days and if I have to cover any other specific areas
> > related to the project, I hope you will guide me through.
> >
> > [1] http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-Event
> > [2] http://www.w3.org/TR/2010/NOTE-xml-events2-20101216/
> > #s_event_module_elements
> >
> > Thanks.
>
> Thanks.
>
>
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
>
>


-- 

Regards

A.S.Thiwanka Somasiri

Skype : executionerwild
MSN   : thiwas@ymail.com
<th...@ymail.com>

Re: New to Apcahe Xerces

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Hi Thiwanka,

Thiwanka Somasiri <as...@gmail.com> wrote on 02/18/2011 04:12:27 PM:

> Hi Michael,
>         I was studying the facts you were asking me to follow and
> got an understanding about what Events, event capture, event
> bubbling, etc are [1][2] and went through the spec for EventListener
> and EventTraget interfaces. Also I noticed
> the DocumentImpl and NodeImpl classes are having event processing
> aspects and they represent the root of the document of the tree and
> structure of the tree(nodes) respectively. In [2], it depicts how an
> event occurred is dispatched down the tree explaining event capture
> and event bubbling. But I am not clear how this "dispatching event"
> is happening and need some help from you to figure it out.

I expect the dispatch for the LSParser to be much simpler than the general
case. Unlike the DOM tree which has ancestor nodes, there's only one
EventTarget (i.e. the LSParser) here.

>         The W3C specification indicates, that events supported by
> asynchronous LSParser objects are LSLoadEvent and LSProgressEvent.
> So, are these the only Event classes that we have to implement
> (in org.apache.xerces.dom.events package) in order to support async
LSParser?

That's correct.

>          I also have an issue of LSLoadEvent. In the spec it clearly
> describes the asynchronous property of LSProgressevent with an
> example. But I cannot imagine such an example where LSParser behaves
> asynchronously with LSLoadEvent because, LSLoadEvent is intended to
> signal the completion of a document load where it does not imply an
> async property(for example, if it signals the progress of loading
> the document we can assume that it is async as it was in
> LSLoadProgressevent). I want to clarify this too(anyway I may be
> wrong and may have misunderstood the case.)

The process is asynchronous. When you call parse() on an asynchronous
LSParser it returns immediately with null. At this point the Document may
not have been constructed yet. At some point later when the parser has
completed its work, an LSLoadEvent is fired at the EventListener which
contains the completed Document that has finished loading. The thread which
called parse() is free to do other work while the parser is busy (on
another thread).

>          I will go through the DOM implementation some more in
> upcoming days and if I have to cover any other specific areas
> related to the project, I hope you will guide me through.
>
> [1] http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-Event
> [2] http://www.w3.org/TR/2010/NOTE-xml-events2-20101216/
> #s_event_module_elements
>
> Thanks.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Re: New to Apcahe Xerces

Posted by Thiwanka Somasiri <as...@gmail.com>.
Hi Michael,
        I was studying the facts you were asking me to follow and got an
understanding about what Events, event capture, event bubbling,
etc are [1][2] and went through the spec for EventListener and EventTraget
interfaces. Also I noticed the DocumentImpl and NodeImpl classes are having
event processing aspects and they represent the root of the document of the
tree and structure of the tree(nodes) respectively. In [2], it depicts how
an event occurred is dispatched down the tree explaining event capture and
event bubbling. But I am not clear how this "dispatching event" is happening
and need some help from you to figure it out.

        The W3C specification indicates, that events supported by
asynchronous LSParser objects are LSLoadEvent and LSProgressEvent. So, are
these the only Event classes that we have to
implement(in org.apache.xerces.dom.events package) in order to support async
LSParser?

         I also have an issue of LSLoadEvent. In the spec it clearly
describes the asynchronous property of LSProgressevent with an example. But
I cannot imagine such an example where LSParser behaves asynchronously with
LSLoadEvent because, LSLoadEvent is intended to signal the completion of a
document load where it does not imply an async property(for example, if it
signals the progress of loading the document we can assume that it is async
as it was in LSLoadProgressevent). I want to clarify this too(anyway I may
be wrong and may have misunderstood the case.)

         I will go through the DOM implementation some more in upcoming days
and if I have to cover any other specific areas related to the project, I
hope you will guide me through.

[1] http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-Event
[2]
http://www.w3.org/TR/2010/NOTE-xml-events2-20101216/#s_event_module_elements

Thanks.

On Mon, Feb 14, 2011 at 11:52 AM, Michael Glavassevich
<mr...@ca.ibm.com>wrote:

>  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: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
>
> Thiwanka Somasiri <as...@gmail.com> 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 <
> mrglavas@ca.ibm.com
> > > 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: mrglavas@ca.ibm.com
> > E-mail: mrglavas@apache.org
>
> > Thiwanka Somasiri <as...@gmail.com> 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 <
> mrglavas@ca.ibm.com
> > > > wrote:
> > > Hi Thiwanka,
> > >
> > > Thiwanka Somasiri <as...@gmail.com> 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: mrglavas@ca.ibm.com
> > > E-mail: mrglavas@apache.org
> > >
> > >
> > >
> > > --
> > >
> > > Regards
> > >
> > > A.S.Thiwanka Somasiri
> > >
> > > Skype : executionerwild
> > > MSN   : thiwas@ymail.com
> >
> >
> >
> > --
> >
> > Regards
> >
> > A.S.Thiwanka Somasiri
> >
> > Skype : executionerwild
> > MSN   : thiwas@ymail.com
>
>


-- 

Regards

A.S.Thiwanka Somasiri

Skype : executionerwild
MSN   : thiwas@ymail.com
<th...@ymail.com>

Re: New to Apcahe Xerces

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
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: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Thiwanka Somasiri <as...@gmail.com> 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
<mrglavas@ca.ibm.com
> > 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: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org

> Thiwanka Somasiri <as...@gmail.com> 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
<mrglavas@ca.ibm.com
> > > wrote:
> > Hi Thiwanka,
> >
> > Thiwanka Somasiri <as...@gmail.com> 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: mrglavas@ca.ibm.com
> > E-mail: mrglavas@apache.org
> >
> >
> >
> > --
> >
> > Regards
> >
> > A.S.Thiwanka Somasiri
> >
> > Skype : executionerwild
> > MSN   : thiwas@ymail.com
>
>
>
> --
>
> Regards
>
> A.S.Thiwanka Somasiri
>
> Skype : executionerwild
> MSN   : thiwas@ymail.com

Re: New to Apcahe Xerces

Posted by Thiwanka Somasiri <as...@gmail.com>.
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
<mr...@ca.ibm.com>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: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
>
> Thiwanka Somasiri <as...@gmail.com> 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 <
> mrglavas@ca.ibm.com
> > > wrote:
> > Hi Thiwanka,
> >
> > Thiwanka Somasiri <as...@gmail.com> 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: mrglavas@ca.ibm.com
> > E-mail: mrglavas@apache.org
> >
> >
> >
> > --
> >
> > Regards
> >
> > A.S.Thiwanka Somasiri
> >
> > Skype : executionerwild
> > MSN   : thiwas@ymail.com
>
>


-- 

Regards

A.S.Thiwanka Somasiri

Skype : executionerwild
MSN   : thiwas@ymail.com
<th...@ymail.com>

Re: New to Apcahe Xerces

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
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: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Thiwanka Somasiri <as...@gmail.com> 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
<mrglavas@ca.ibm.com
> > wrote:
> Hi Thiwanka,
>
> Thiwanka Somasiri <as...@gmail.com> 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: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
>
>
>
> --
>
> Regards
>
> A.S.Thiwanka Somasiri
>
> Skype : executionerwild
> MSN   : thiwas@ymail.com

Re: New to Apcahe Xerces

Posted by Thiwanka Somasiri <as...@gmail.com>.
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
<mr...@ca.ibm.com>wrote:

> Hi Thiwanka,
>
> Thiwanka Somasiri <as...@gmail.com> 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 for GSoC
> 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: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
>
>


-- 

Regards

A.S.Thiwanka Somasiri

Skype : executionerwild
MSN   : thiwas@ymail.com
<th...@ymail.com>

Re: New to Apcahe Xerces

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Hi Thiwanka,

Thiwanka Somasiri <as...@gmail.com> 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 for GSoC
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: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Re: New to Apcahe Xerces

Posted by Thiwanka Somasiri <as...@gmail.com>.
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 for GSoC 2011?

Thanks.

On Sun, Feb 6, 2011 at 2:00 AM, Michael Glavassevich <mr...@ca.ibm.com>wrote:

> Hi Thiwanka,
>
> Welcome.
>
> A good place to start is the Xerces Native Interface. This is the framework
> on which the parser and other components of Xerces' are built. You'll find
> details on the website here [1]. If you're also fairly new to XML I would
> suggest familiarizing yourself with the various standards that Xerces [2]
> supports.
>
> If you're curious about looking at the code, you could extract it from SVN
> [3]. The project is self contained so you can compile it directly (with the
> Ant build.xml) without needing to download additional tools. If you use
> Eclipse the repository has .classpath, .project and .settings/* files that
> will set up your environment for development, consistent with how the
> committers are doing development on Xerces-J.
>
> You'll find samples [4] in the 'samples' directory and also in the binary
> distribution. These demonstrate usage of Xerces' various APIs. By setting
> breakpoints in a debugger, they can also be used to gain an understanding of
> how the XML data flows through the various internal components and how those
> components work and interact with each other.
>
> Hope that gives you some good ideas on where to start.
>
> Thanks.
>
> [1] http://xerces.apache.org/xerces2-j/xni.html
> [2] http://xerces.apache.org/library.html
> [3] http://xerces.apache.org/xerces2-j/source-repository.html
> [4] http://xerces.apache.org/xerces2-j/samples.html
>
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
>
> Thiwanka Somasiri <as...@gmail.com> wrote on 02/05/2011 12:12:48 PM:
>
> > Hi,
>
> >
> >    I am new to Apache Xerces and I am willing to contribute to the
> > project. Can someone tell me where to start to move forward? And I
> > am interested in Xerces2 Java Parser.
> >
> > thanks.
> >
> > --
> >
> > Regards
> >
> > A.S.Thiwanka Somasiri
> >
> > Skype : executionerwild
> > MSN   : thiwas@ymail.com
>
>


-- 

Regards

A.S.Thiwanka Somasiri

Skype : executionerwild
MSN   : thiwas@ymail.com
<th...@ymail.com>

Re: New to Apcahe Xerces

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Hi Thiwanka,

Welcome.

A good place to start is the Xerces Native Interface. This is the framework
on which the parser and other components of Xerces' are built. You'll find
details on the website here [1]. If you're also fairly new to XML I would
suggest familiarizing yourself with the various standards that Xerces [2]
supports.

If you're curious about looking at the code, you could extract it from SVN
[3]. The project is self contained so you can compile it directly (with the
Ant build.xml) without needing to download additional tools. If you use
Eclipse the repository has .classpath, .project and .settings/* files that
will set up your environment for development, consistent with how the
committers are doing development on Xerces-J.

You'll find samples [4] in the 'samples' directory and also in the binary
distribution. These demonstrate usage of Xerces' various APIs. By setting
breakpoints in a debugger, they can also be used to gain an understanding
of how the XML data flows through the various internal components and how
those components work and interact with each other.

Hope that gives you some good ideas on where to start.

Thanks.

[1] http://xerces.apache.org/xerces2-j/xni.html
[2] http://xerces.apache.org/library.html
[3] http://xerces.apache.org/xerces2-j/source-repository.html
[4] http://xerces.apache.org/xerces2-j/samples.html

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Thiwanka Somasiri <as...@gmail.com> wrote on 02/05/2011 12:12:48 PM:

> Hi,
>
>    I am new to Apache Xerces and I am willing to contribute to the
> project. Can someone tell me where to start to move forward? And I
> am interested in Xerces2 Java Parser.
>
> thanks.
>
> --
>
> Regards
>
> A.S.Thiwanka Somasiri
>
> Skype : executionerwild
> MSN   : thiwas@ymail.com