<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">This email thread goes in circles :)<br><br>You need to implement your own custom parser and visitor class. The code I gave you before would go in the custom visitor class.<br><br>Olli<br><br>--- On <b>Sat, 27/9/08, Christoph P. Kukulies <i><kuku@physik.rwth-aachen.de></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">From: Christoph P. Kukulies <kuku@physik.rwth-aachen.de><br>Subject: Re: [opencms-dev] <cms:parse> usage<br>To: olli_aro@yahoo.co.uk, "The OpenCms mailing list" <opencms-dev@opencms.org><br>Date: Saturday, 27 September, 2008, 8:33 AM<br><br><pre>Thanks, Olli, that's fine, that you are showing me how to access the tag<br>resp. how to overwrite the method.<br><br>What I still don't get, where in the workplace or in OpenCms I should<br>put the code? Should I
write a jsp? Should I dig into the OpenCms code?<br><br>Cheers,<br><br>--<br>Chris Christoph P. U. Kukulies kukulies (at) rwth-aachen.de<br><br>On Fri, Sep 26, 2008 at 11:21:24PM +0100, Olli Aro wrote:<br>> Aaah, I remember now. That is why I suggested the custom parser in the<br>first<br>> place.<br>> <br>> So, in that case your code would be something like this:<br>> <br>> public void visitTag(Tag tag) {<br>> <br>> //Parse links<br>> if(tag.getTagName().equals("A")){<br>> <br>> String link=tag.getAttribute("HREF");<br>> <br>> myMethodAppendingToFile(link);<br>> }<br>> <br>> super.visitTag(tag);<br>> }<br>> <br>> Regards,<br>> <br>> Olli<br>> <br>> -----Original Message-----<br>> From: Christoph P. Kukulies [mailto:kuku@physik.rwth-aachen.de] <br>> Sent: 26 September 2008 17:08<br>> To:
olli_aro@yahoo.co.uk; The OpenCms mailing list<br>> Subject: Re: [opencms-dev] <cms:parse> usage<br>> <br>> On Fri, Sep 26, 2008 at 03:03:37PM +0100, Olli Aro wrote:<br>> > Well you cannot paste that code in as it is in your CustomVisitor,<br>since<br>> it<br>> > includes references to all kind of bespoken stuff we have. It was<br>just an<br>> > illustration on how to use the parsers and add width and height<br>property<br>> to<br>> > image tags that are missing it.<br>> > <br>> > Maybe it would help if you tell me what you are hoping to achieve<br>with<br>> your<br>> > custom parser and then I can give you pointers on how to do it?<br>> <br>> <br>> Actually I was seeking a way to write out all links in my pages into a<br>> file. Something that wget -r does from the outside.<br>> <br>> <br>> --<br>> Chris Christoph P. U. Kukulies kukulies (at)
rwth-aachen.de<br>> <br>> > <br>> > Regards,<br>> > <br>> > Olli<br>> > <br>> > -----Original Message-----<br>> > From: Christoph P. Kukulies [mailto:kuku@physik.rwth-aachen.de] <br>> > Sent: 26 September 2008 14:43<br>> > To: olli_aro@yahoo.co.uk; The OpenCms mailing list<br>> > Subject: Re: [opencms-dev] <cms:parse> usage<br>> > <br>> > <br>> > Hi Olli,<br>> > <br>> > I'm following this thread with great interest. Still I - me<br>mundane -<br>> > have no idea where one should put that code piece below.<br>> > <br>> > <br>> > On Fri, Sep 26, 2008 at 02:05:58PM +0100, Olli Aro wrote:<br>> > > The whole point of this is that you can parse through the<br>content inside<br>> > the<br>> > > tag and do what ever you like with that content. The most common<br>> > application<br>> > > would be to
manipulate content. For example we have used this in<br>order<br>> to<br>> > > ensure that all images in the content have width and height<br>attributes<br>> > set.<br>> > > <br>> > > Below is some code for you for this application:<br>> > > <br>> > > /*<br>> > > * (non-Javadoc)<br>> > > * @see<br>org.opencms.util.CmsHtmlParser#visitTag(org.htmlparser.Tag)<br>> > > */<br>> > > public void visitTag(Tag tag) {<br>> > > <br>> > <br>> > ....<br>> > <br>> > --<br>> > Chris Christoph P. U. Kukulies kukulies (at) rwth-aachen.de<br></pre></blockquote></td></tr></table><br>