From quanta-devel Wed Jan 25 13:46:59 2006 From: Andras Mantia Date: Wed, 25 Jan 2006 13:46:59 +0000 To: quanta-devel Subject: Re: [quanta-devel] more ideas for the parser Message-Id: <200601251547.00092.amantia () kde ! org> X-MARC-Message: https://marc.info/?l=quanta-devel&m=113819685223181 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============0296102837==" --===============0296102837== Content-Type: multipart/signed; boundary="nextPart2251230.3pX8UGIiD2"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart2251230.3pX8UGIiD2 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 25 January 2006 11:50, Jens Herden wrote: > Hi Andras, > > > Back here: is namespace support really needed at this stage of > > parsing? I mean, what I described in that diagram finds the > > beginning of the XML tag and the end of it (and of course the text > > between the begin and end). I thought that it is the builder's job > > to break (parse) the found XML tag, so it identifies the: > > - namespace > > - tag name > > - the attributes > > - the attribute values > > - if it is a closing/opening tag > > I do not think so. My understanding is that the parser breaks this > apart and the builder only creates the tree from the pieces. > Please look into kdom/backends/qxml/QXmlParser.cpp to see the > connection I am thinking about. Here is the point where our new > parser should drop into KDOM, at least that is what I am currently > thinking ;-) Ok, so KDOM expects to feed the completely parsing element with=20 namespace, name, attributes and their values. No problem, we can do the=20 tag-parsing when the XML End state is entered and call the builder=20 there. I am in favor of this approach as otherwise our state machine=20 will be overly complicated. So the workflow will be: =2D "<" is read: enter the XML start state, remember this position [pos1] =2D for other characters just go through the stated below the XML Start=20 state =2D when ">" is read, enter the XML End state. Here we have the [pos1] and= =20 the current position. The tag is between them. Find the namespace, the=20 name, the attributes, attribute values, if it is a single tag and if it=20 is a closing tag and call the QXmlContentHandler::startElement() or=20 endElement() or both with the right arguments.=20 Do you have a problem with this approach? Andras =2D-=20 Quanta Plus developer - http://quanta.kdewebdev.org K Desktop Environment - http://www.kde.org --nextPart2251230.3pX8UGIiD2 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQBD14FUTQdfac6L/08RAmb5AKCPAo+gppNvupbGg35P14bpOuEP/gCdG4gp ZSolh0GVEn2SeApT5xX7F6U= =BBlW -----END PGP SIGNATURE----- --nextPart2251230.3pX8UGIiD2-- --===============0296102837== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ quanta-devel mailing list quanta-devel@kde.org https://mail.kde.org/mailman/listinfo/quanta-devel --===============0296102837==--