From sheidev@yahoo.de Thu Nov 19 17:48:31 2015 From: Sebastian Heidbrink To: moose-dev@list.inf.unibe.ch Subject: [Moose-dev] petitparser question Date: Thu, 19 Nov 2015 16:48:31 +0000 Message-ID: <564DFD76.6030606@yahoo.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9171666983632444867==" --===============9171666983632444867== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hi! I watched Tudor's looong tutorial on PetitParser and I still can't find a solution for one of my inputs. I would like to parse a file that includes HTML templates but it is no HTML file!. Since there is no PPHTMLParser and the XMLHTMLParser extends the import by missing pieces, I decided to write my own PPParser. I have trouble with nested parts now. How would I parse something like this?: ..... ..... .... .... template is the node I am interested in but how can I keep trac on which level I am and if I may expect another /template tag or not? The file also includes other information and could have more than just one part with "templates". Is the "indent" support something I should have a look at? Doru! Thank you for this great presentation! Exeptt for this problem it included solutions on all my needs! Thank you! Sebastian --===============9171666983632444867==-- From sheidev@yahoo.de Fri Nov 20 21:53:23 2015 From: Sebastian Heidbrink To: moose-dev@list.inf.unibe.ch Subject: [Moose-dev] Re: petitparser question Date: Fri, 20 Nov 2015 20:53:23 +0000 Message-ID: <564F8855.80504@yahoo.de> In-Reply-To: <564DFD76.6030606@yahoo.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1464350027266698939==" --===============1464350027266698939== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Okay got it! (templateStart trim, ((#any asParser starLazy: templateEnd) flatten trim, templateEnd trim) star ) flatten Sebastian Am 19.11.2015 um 08:48 schrieb Sebastian Heidbrink: > Hi! > > I watched Tudor's looong tutorial on PetitParser and I still can't > find a solution for one of my inputs. > > I would like to parse a file that includes HTML templates but it is no > HTML file!. > Since there is no PPHTMLParser and the XMLHTMLParser extends the > import by missing pieces, I decided to write my own PPParser. > > I have trouble with nested parts now. > How would I parse something like this?: > ..... > ..... > > .... > .... > > > template is the node I am interested in but how can I keep trac on > which level I am and if I may expect another /template tag or not? > > The file also includes other information and could have more than just > one part with "templates". > > Is the "indent" support something I should have a look at? > > Doru! Thank you for this great presentation! Exeptt for this problem > it included solutions on all my needs! > > Thank you! > Sebastian > _______________________________________________ > Moose-dev mailing list > Moose-dev(a)list.inf.unibe.ch > https://www.list.inf.unibe.ch/listinfo/moose-dev > --===============1464350027266698939==--