Hi Neil,

Mine program too works fine  for XML docs of finite depth.

like, a sample of,
  <icim>
    <object name="a">
      <relationship name="to">
        <object name="a">
          <relationship name="to">
            <object name="a">
            </object>
          </relationship>
        </object>
      </relationship>
    </object>
  </icim>

with a depth of 5, works just fine. a sample like this with a depth
upto 3000 works fine. But if i keep extending this sample to a
depth more than 3000, then the program crashes.

But anyways, Thanks a lot.
renin.


> -----Original Message-----
> From: Neil Graham [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 21, 2003 1:36 PM
> To: [EMAIL PROTECTED]
> Subject: RE: XercesDOMParser::parse() - Is this Recursive?
>
>
> Hi Renin,
>
> No, that doesn't produce a very complex DFA and so not much
> recursion would
> be entailed.  Just in case though I made a little document containing your
> grammar snippet and the parser ate it up happily.
>
> Cheers,
> Neil
> Neil Graham
> XML Parser Development
> IBM Toronto Lab
> Phone:  905-413-3519, T/L 969-3519
> E-mail:  [EMAIL PROTECTED]
>
>
>
>
> |---------+----------------------------->
> |         |           "Renin Jegadeesan"|
> |         |           <renin.jegadeesan@|
> |         |           smarts.com>       |
> |         |                             |
> |         |           03/21/2003 01:14  |
> |         |           PM                |
> |         |           Please respond to |
> |         |           xerces-c-dev      |
> |         |                             |
> |---------+----------------------------->
>
> >-----------------------------------------------------------------
> ------------------------------------------------------------------
> ----------|
>   |
>
>             |
>   |       To:       <[EMAIL PROTECTED]>
>
>             |
>   |       cc:
>
>             |
>   |       Subject:  RE: XercesDOMParser::parse() - Is this
> Recursive?
>                    |
>   |
>
>             |
>   |
>
>             |
>
> >-----------------------------------------------------------------
> ------------------------------------------------------------------
> ----------|
>
>
>
>
> Neil,
>
> Thank you very much for the answer.
>
> I thought i had a very simple grammar in my DTD. It does have a loop
> though.
> Is that what you refer to as a "complicated Grammar"?
>
> My Grammar is,
>
>              <!ELEMENT icim ( object )* >
>
>              <!ELEMENT object ( relationship )* >
>              <!ATTLIST object                    name      CDATA  >
>
>              <!ELEMENT relationship ( object )* >
>              <!ATTLIST relationship              name      CDATA  >
>
>
> Thanks in advance.
> renin.
>
>
> > -----Original Message-----
> > From: Neil Graham [mailto:[EMAIL PROTECTED]
> > Sent: Friday, March 21, 2003 1:00 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: XercesDOMParser::parse() - Is this Recursive?
> >
> >
> > Hi Renin,
> >
> > While the parser's use of a state-machine for validation does indeed not
> > entail recursion, there's certainly recursion required to convert the
> > representation derived from the grammar into a state machine.  So it's
> > possible that, if the grammar you're using is very complicated,
> you could
> > run into stack problems in that phase.
> >
> > If this is the difficulty though, it would relate to the
> > complexity of your
> > grammar not to the depth of your DOM tree.  Setting a debugger on your
> > program might indeed be useful to tell you at least what phase of
> > processing you're in when the problem occurs.
> >
> > Cheers,
> > Neil
> > Neil Graham
> > XML Parser Development
> > IBM Toronto Lab
> > Phone:  905-413-3519, T/L 969-3519
> > E-mail:  [EMAIL PROTECTED]
> >
> >
> >
> >
> > |---------+----------------------------->
> > |         |           "Renin Jegadeesan"|
> > |         |           <renin.jegadeesan@|
> > |         |           smarts.com>       |
> > |         |                             |
> > |         |           03/21/2003 12:41  |
> > |         |           PM                |
> > |         |           Please respond to |
> > |         |           xerces-c-dev      |
> > |         |                             |
> > |---------+----------------------------->
> >
> > >-----------------------------------------------------------------
> > ------------------------------------------------------------------
> > ----------|
> >   |
> >
> >             |
> >   |       To:       <[EMAIL PROTECTED]>
> >
> >             |
> >   |       cc:
> >
> >             |
> >   |       Subject:  RE: XercesDOMParser::parse() - Is this
> > Recursive?
> >                    |
> >   |
> >
> >             |
> >   |
> >
> >             |
> >
> > >-----------------------------------------------------------------
> > ------------------------------------------------------------------
> > ----------|
> >
> >
> >
> >
> > Hi Dave,
> > Thanks a lot for the answer.
> > I figured as much as, the reading the xml document and creating the
> > DOM Tree would be non-recursive, but i was concerned about the
> > Validation part.
> > Unfortunately, my program is crashing if the depth of the DOM Tree
> > is around 3000. I was thinking this would be a stack overflow.
> > But if it is not, then i need to build a debug library and debug
> > it.
> >
> > Thanks again.
> > renin.
> >
> >
> > > -----Original Message-----
> > > From: David N Bertoni/Cambridge/IBM
> [mailto:[EMAIL PROTECTED]
> > > Sent: Friday, March 21, 2003 12:25 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: RE: XercesDOMParser::parse() - Is this Recursive?
> > >
> > >
> > >
> > >
> > >
> > >
> > > Hi Renin,
> > >
> > > The parser doesn't traverse a DOM tree.  It parses an XML stream
> > > and builds
> > > a DOM from that stream.  Most of the information that maintains
> > the state
> > > of the parse is not kept on the stack, and the parser is not
> implemented
> > > using recursive descent -- it's a state machine.
> > >
> > > Dave
> > >
> > >
> > >
> > >
> > >
> > >                       "Renin Jegadeesan"
> > >
> > >                       <renin.jegadeesan@         To:
> > > <[EMAIL PROTECTED]>
> > >                       smarts.com>                cc:      (bcc:
> > > David N Bertoni/Cambridge/IBM)
> > >                                                  Subject: RE:
> > > XercesDOMParser::parse() - Is this Recursive?
> > >                       03/21/2003 07:20
> > >
> > >                       AM
> > >
> > >                       Please respond to
> > >
> > >                       xerces-c-dev
> > >
> > >
> > >
> > >
> > >
> > >
> > > I am sorry i wasn't clear. I understood from the code that it's not
> > > re-entrant.
> > >
> > > what i meant was, does the XercesDOMParser::parse() traverse the DOM
> > > Tree in a recursive manner?
> > >
> > > since my program is multi-threaded, i am worried if this traversing
> > > is done in a recursive manner, the depth of the DOM tree would be
> > > constrained by the stack size for this thread, and if the DOM Tree
> > >  is deep enough, then my program would crash.
> > >
> > > Thanks again, for any help.
> > > renin.
> > >
> > >
> > > > -----Original Message-----
> > > > From: David N Bertoni/Cambridge/IBM
> > [mailto:[EMAIL PROTECTED]
> > > > Sent: Thursday, March 20, 2003 7:05 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: Re: XercesDOMParser::parse() - Is this Recursive?
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > HI Renin,
> > > >
> > > > If you mean "re-entrant" the answer is no -- a single instance of a
> > > parser
> > > > can only parse one document at a time.  See:
> > > >
> > > >    http://xml.apache.org/xerces-c/faq-parse.html#faq-7
> > > >
> > > > Dave
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >                       "Renin Jegadeesan"
> > > >
> > > >                       <renin.jegadeesan@         To:
> > > > <[EMAIL PROTECTED]>
> > > >                       smarts.com>                cc:      (bcc:
> > > > David N Bertoni/Cambridge/IBM)
> > > >                                                  Subject:
> > > > XercesDOMParser::parse() - Is this Recursive?
> > > >                       03/20/2003 03:29
> > > >
> > > >                       PM
> > > >
> > > >                       Please respond to
> > > >
> > > >                       xerces-c-dev
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Hi,
> > > > I am a newbie at using Xerces C++. I have written a multi-threaded
> > > program
> > > > that uses the XercesDOMParser to parse my xml document.
> > > >
> > > > I am wondering if the XercesDOMParser::parse() is
> recursive? I looked
> > > > at the source code, and it appears to be non-recursive. But the
> source
> > > > code is really complicated, and i would appreciate it, if one of the
> > > > experts on this mailing list can answer this question for me.
> > > >
> > > > Thank you in advance,
> > > > - Renin
> > > > (914) 798-8561
> > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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

Reply via email to